[R-sig-ME] Simulating Cluster RCTs
Ben Bolker
bbolker @ending from gm@il@com
Sat Jun 2 08:48:41 CEST 2018
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 ..
On Fri, Jun 1, 2018 at 4:54 PM, Ulf Köther <ukoether using uke.de> wrote:
> 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
>
>
> Am 01.06.2018 um 14:53 schrieb 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
> _______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
More information about the R-sig-mixed-models
mailing list