Skip to content
Prev 2546 / 20628 Next

Modeling correlation structure in mixed models

Hi Phillip,

Welcome.  Although I'm a fan of PROC MIXED, I think you'll find doing
your mixed modeling in R a relative joy.  Unfortunately, to experience
the joy one must learn to navigate the byzantine labyrinth of
documentation that has grown from this community effort.  A few leads
are offered below...


On Fri, Jun 26, 2009 at 4:42 PM, Phillip
Chapman<pchapman at stat.colostate.edu> wrote:
P&B is of course the authoritative reference for the nlme package, and
Doug has mentioned on this list that in his (limited) spare time he is
working on a book to accompany lme4.  The lme4 package does come with
several vignettes that can be accessed from R by a call to the
vignette function or by simply opening the pdfs in
yourRlibrary/lme4/doc/.  There is also a vignette in the SASmixed
package called 'lmer for SAS PROC MIXED Users'.  Other helpful
references can be found on the CRAN contributed documentation section,
such as the Mixed Models Web Appendix to John Fox's book.  I haven't
read Gelman and Hill's Data Analysis and Regression using
Multilevel/Hierarchical models, but as I understand it they user lmer
extensively, with wrappers for Bayesian inferences.  Also, Harald
Baayen has a freely available draft of a book on analyzing linguistic
data that includes many lmer examples:
http://www.ualberta.ca/~baayen/publications.html

Googling the following may also be useful:
lmer filetype:pdf

Here are some of Doug's documents that show up:

www.stat.wisc.edu/~bates/reports/MixedComp.pdf
user2007.org/program/presentations/bates.pdf
http://www.jstatsoft.org/v20/i02
www.stat.wisc.edu/~bates/IMPS2008/lme4D.pdf
This is something that I have wondered about as well -- as far as I
know one can only specify a correlation structure for the error
covariance matrix, and only using the nlme package (not lme4).
However, given that there are thousands of R packages available I
would not be surprised if someone's already coded up a way to do this
(perhaps in one of the spatial packages using a Bayesian approach,
such as spBayes or geoRglm?)
Although nlme is designed for nested data, crossed random effects can
be specified using a combination of pdBlocked and pdIdent objects (see
page 163 of P&B).  However it's an awkward specification and the
fitting can be slow (IIRC). On the other hand lmer offers elegant
methods of specifying crossed models and speedy methods for fitting
them.
You're welcome -- hope it helped,

Kingsford Jones