Skip to content

Package for GLMM with correlation matrix

2 messages · wong, Ben Bolker

#
Hi,

I'm looking for a R package for fitting a generalized linear mixed model
    g(E[y])=X?+Zu
where g is a link function, ? is a p vector of fixed effects, u is a
vector of random effects, X is design matrix, Z is an identity matrix.
In our data, each individual has only one observation for response y.
Because individuals may be correlated in some way, leading to similar
reponses, random effect u is employed to correct for individual
background effect. The variance of u is assumed to be Var[u]=G*?^2, in
which G is a correlation matrix.

glmmPQL in MASS has an argument for correlation. However, I
encountered an error of invalid formula when using a n*n dimension
matrix G (n is the number of individuals, and also the length of y)
for argument 'correlation' in glmmPQL. For example:
iteration 1
Error in formula.default(object) : invalid formula

The R help documentation for glmmPQL is very compact. No detailed
explanation. Does anybody know how to use correlation matrix in
glmmPQL? Is it good to use glmmPQL for fitting my model?

Thanks.

Alex
#
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

   See the documentation for lme (nlme package), specifically ?lme and
?corClasses .
Beyond that, see Pinheiro and Bates 2000 (Springer).
On 10-10-22 05:35 AM, wong wrote:
y=sample(c(1,0),48,replace=T);x=sample(1:4,48,replace=T);id=1:48;covMat=matrix(rnorm(48*48),nrow=48)
glmmPQL(y~x,random=~1|id,family=binomial,correlation=covMat)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkzBiFwACgkQc5UpGjwzenNcGgCfSlBm9eQ7EBwncwlOrxOhFW3u
EMsAn2j5HS2gPIcmpY6s09ktd6cCeeFJ
=ntzB
-----END PGP SIGNATURE-----