Repeated measures statistics in R (updated)

Within subjects ANOVA on balanced designs is straightforward in R. Repeated measures regression for unbalanced data, or for non-Gaussian, e.g., binary data and beyond is a tad more tricky (not just in R).

  1. lmer in the lme4 package seems to be the most popular function for fitting generalized linear mixed-effects models.  For MCMC generated p-values, the languageR package has the useful pvals.fnc function.
  2. clmm in the ordinal package does mixed-effects models for ordinal outcomes.
  3. For binary and poisson distributed outcomes, and with a random intercept, glmmML (in the glmmML package) was recommended as a possible alternative to lmer.
  4. By far the clearest explanation of fixed and random effects I have found so far is in Gelman and Hill’s (2007) Data Analysis Using Regression and Multilevel/Hierarchical Models.  This also has nice hints on standardising variables and the various methods for dealing with categoricals predictors. The associated arm package is useful.
  5. For explaining how contrasts work in R, I found this web page was helpful. As is Chapter 12 of Michael Crawley’s Statistics: An Introduction using R.
  6. There’s the wiki, GLMMs for ecologists and evolutionary biologists
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s