Discussion:
[R-sig-ME] Simulating Cluster RCTs
Kevin E. Thorpe
2018-06-01 12:53:14 UTC
Permalink
Hi All.

Apologies if this is the wrong list but after searching I have not found
what I am looking for.

I would like (mainly for teaching) to be able to simulate cluster RCTs
with continuous and binary outcomes. It appears to me that
simulate.merMod in lme4 may be one way to do this. Unfortunately, I am a
bit lost in the help file. For one thing, in the newparams argument, I
have no idea what theta is.

Also, in the simulations I would like to be able to specify an ICC to
control the clustering effect as well as the usual things (e.g. mean
response in the control group, treatment effect, number of clusters and
cluster sizes).

I would be most appreciative for any guidance or examples of this type
of simulation, either with simulate.merMod or other approaches.

Thank you in advance for your time.

Kevin
--
Kevin E. Thorpe
Head of Biostatistics, Applied Health Research Centre (AHRC)
Li Ka Shing Knowledge Institute of St. Michael's Hospital
Assistant Professor, Dalla Lana School of Public Health
University of Toronto
email: ***@utoronto.ca Tel: 416.864.5776 Fax: 416.864.3016
Ulf Köther
2018-06-01 20:54:57 UTC
Permalink
Hi Kevin,

I think that a more appropriate way to achieve your goal is to have a
look at a library that explicitly deals with the simulation of data.
Especially, you should look into the "simstudy" package, which is
developed by Keith Goldfield, which is, as I recall it, clearly able to
do what you want:

The package:

https://cran.r-project.org/web/packages/simstudy/index.html

Goldfield's blog about generating data using simstudy:

https://www.rdatagen.net/

His posts about clustered data:

https://www.rdatagen.net/page/clustered/

Good luck,

Ulf
Post by Kevin E. Thorpe
Hi All.
Apologies if this is the wrong list but after searching I have not found
what I am looking for.
I would like (mainly for teaching) to be able to simulate cluster RCTs
with continuous and binary outcomes. It appears to me that
simulate.merMod in lme4 may be one way to do this. Unfortunately, I am a
bit lost in the help file. For one thing, in the newparams argument, I
have no idea what theta is.
Also, in the simulations I would like to be able to specify an ICC to
control the clustering effect as well as the usual things (e.g. mean
response in the control group, treatment effect, number of clusters and
cluster sizes).
I would be most appreciative for any guidance or examples of this type
of simulation, either with simulate.merMod or other approaches.
Thank you in advance for your time.
Kevin
--
_____________________________________________________________________

Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg | www.uke.de
Vorstandsmitglieder: Prof. Dr. Burkhard Göke (Vorsitzender), Prof. Dr. Dr. Uwe Koch-Gromus, Joachim Prölß, Martina Saurin (komm.)
_____________________________________________________________________

SAVE PAPER - THINK BEFORE PRINTING
Ben Bolker
2018-06-02 06:48:41 UTC
Permalink
If you can find an existing package that does the kind of model you
want, that would certainly be recommended. You could also look at the
power analysis section of the GLMM FAQ
https://bbolker.github.io/mixedmodels-misc/glmmFAQ.html#power-analysis

For scalar/intercept-only random effects, the theta parameters are the
among-group standard deviations (scaled by the residual standard
deviation, for linear mixed models). For random-slopes models it's
(alas) more complicated -- the theta parameters are the elements of
the (scaled) Cholesky factor of the variance-covariance matrix -- but
you could use the functions in ?vcconv to convert from
variance-covariance matrices to Cholesky factors ..
Post by Ulf Köther
Hi Kevin,
I think that a more appropriate way to achieve your goal is to have a
look at a library that explicitly deals with the simulation of data.
Especially, you should look into the "simstudy" package, which is
developed by Keith Goldfield, which is, as I recall it, clearly able to
https://cran.r-project.org/web/packages/simstudy/index.html
https://www.rdatagen.net/
https://www.rdatagen.net/page/clustered/
Good luck,
Ulf
Post by Kevin E. Thorpe
Hi All.
Apologies if this is the wrong list but after searching I have not found
what I am looking for.
I would like (mainly for teaching) to be able to simulate cluster RCTs
with continuous and binary outcomes. It appears to me that
simulate.merMod in lme4 may be one way to do this. Unfortunately, I am a
bit lost in the help file. For one thing, in the newparams argument, I
have no idea what theta is.
Also, in the simulations I would like to be able to specify an ICC to
control the clustering effect as well as the usual things (e.g. mean
response in the control group, treatment effect, number of clusters and
cluster sizes).
I would be most appreciative for any guidance or examples of this type
of simulation, either with simulate.merMod or other approaches.
Thank you in advance for your time.
Kevin
--
_____________________________________________________________________
Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg | www.uke.de
Vorstandsmitglieder: Prof. Dr. Burkhard Göke (Vorsitzender), Prof. Dr. Dr. Uwe Koch-Gromus, Joachim Prölß, Martina Saurin (komm.)
_____________________________________________________________________
SAVE PAPER - THINK BEFORE PRINTING
_______________________________________________
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
Kevin E. Thorpe
2018-06-02 14:38:24 UTC
Permalink
Thank you both for the advice.

Kevin
Post by Ben Bolker
If you can find an existing package that does the kind of model you
want, that would certainly be recommended. You could also look at the
power analysis section of the GLMM FAQ
https://bbolker.github.io/mixedmodels-misc/glmmFAQ.html#power-analysis
For scalar/intercept-only random effects, the theta parameters are the
among-group standard deviations (scaled by the residual standard
deviation, for linear mixed models). For random-slopes models it's
(alas) more complicated -- the theta parameters are the elements of
the (scaled) Cholesky factor of the variance-covariance matrix -- but
you could use the functions in ?vcconv to convert from
variance-covariance matrices to Cholesky factors ..
Post by Ulf Köther
Hi Kevin,
I think that a more appropriate way to achieve your goal is to have a
look at a library that explicitly deals with the simulation of data.
Especially, you should look into the "simstudy" package, which is
developed by Keith Goldfield, which is, as I recall it, clearly able to
https://cran.r-project.org/web/packages/simstudy/index.html
https://www.rdatagen.net/
https://www.rdatagen.net/page/clustered/
Good luck,
Ulf
Post by Kevin E. Thorpe
Hi All.
Apologies if this is the wrong list but after searching I have not found
what I am looking for.
I would like (mainly for teaching) to be able to simulate cluster RCTs
with continuous and binary outcomes. It appears to me that
simulate.merMod in lme4 may be one way to do this. Unfortunately, I am a
bit lost in the help file. For one thing, in the newparams argument, I
have no idea what theta is.
Also, in the simulations I would like to be able to specify an ICC to
control the clustering effect as well as the usual things (e.g. mean
response in the control group, treatment effect, number of clusters and
cluster sizes).
I would be most appreciative for any guidance or examples of this type
of simulation, either with simulate.merMod or other approaches.
Thank you in advance for your time.
Kevin
--
Kevin E. Thorpe
Head of Biostatistics, Applied Health Research Centre (AHRC)
Li Ka Shing Knowledge Institute of St. Michael's Hospital
Assistant Professor, Dalla Lana School of Public Health
University of Toronto
email: ***@utoronto.ca Tel: 416.864.5776 Fax: 416.864.3016
Loading...