Re: [R] Power analysis and mixed model

From: Doran, Harold <HDoran_at_air.org>
Date: Wed 04 Apr 2007 - 15:06:06 GMT


One option is to use lmer in a monte carlo simulation. I just did this last week. Check out the article published in the American Statistician and can be found at http://maven.smith.edu/~nhorton/R/r.pdf.

The article is not about power per se, but is about R as a toolbox for mathematical statistics. But, it has a section illustrating how to do power calculations via simulation using the nlme package in R, which is the function for multilevel models.

I simulate data for clustered designs differently than the authors and I also use lmer2() in the lme4 package and not nlme as it is much, much faster.

We needed to know how many clusters to have to obtain sufficient power. I ran power calculations for a decently complex model with cluster sizes of 10 to 200 in increments of 10 (i.e., 10, 20, ..., 200) with 1000 iterations at each cluster size. This is a total of 20,000 iterations (20 * 1000) and took about 1.5 hours on my desktop machine.

There are power calculators, like Optim, but simulation gives you much more flexibility and the option to estimate power in situations where formulae do not exist.

Harold

> -----Original Message-----
> From: r-help-bounces@stat.math.ethz.ch
> [mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of Julien
> Sent: Wednesday, April 04, 2007 10:40 AM
> To: r-help@stat.math.ethz.ch
> Subject: [R] Power analysis and mixed model
>
> Hi
>
> Is there any way to compute power analysis for a mixed model ?
>
> Julien
>
>
>
> Julien Martin
>
> Candidat au Doctorat
>
> Laboratoire de Marco festa-Bianchet
>
> Université de Sherbrooke
>
> Sherbrooke, Québec
>
> J1K 2R1 Canada
>
> 819 821 8000 poste 62059
>
>
>
>
> --
>
> Checked by AVG Free Edition.
>
> 12:48
>
>
> [[alternative HTML version deleted]]
>
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu Apr 05 01:13:38 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 04 Apr 2007 - 15:30:53 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.