[R] specify the covariance matrix for random effect
Ben Bolker
bbolker at gmail.com
Fri Sep 3 14:34:54 CEST 2010
Ben Bolker <bbolker <at> gmail.com> writes:
>
> Qiu, Weiyu <weiyu <at> ualberta.ca> writes:
>
> >
> > Hi,
> >
> > I'm doing a generalized linear mixed model, and I currently use an
> > R function called "glmm".
>
> If you could get by with an AR or ARMA structure then you could
> use lme() with the 'correlation' argument from the nlme package.
> If you have enough data/are willing to fit a completely unstructured
> correlation matrix, you could use corSymm. See ?corStruct in
> the nlme package documentation: it is *in principle* possible to
> write functions to implement your own correlation structures, e.g.
> see
>
[snip]
oops. I neglected the fact that you're doing a GLMM. nlme only
does LMMs.
You may be able to follow my advice regarding setting up the
autocorrelation structure and then use glmmPQL in the MASS package
(which is built on top of nlme).
More information about the R-help
mailing list