[R-sig-ME] Package for GLMM with correlation matrix

Ben Bolker bbolker at gmail.com
Fri Oct 22 14:49:32 CEST 2010


-----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:
> 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:
>
>>
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)
> 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
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

-----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-----




More information about the R-sig-mixed-models mailing list