[R-sig-ME] Question about linear mixed model
Hung-Chih Ku
Hung-Chih.Ku at utsouthwestern.edu
Thu Sep 11 18:22:00 CEST 2014
Dear all,
I am trying to estimate variance components from a linear mixed model Y=Xa+Zb+e where Z is an nxp unstructured matrix. The following is an example of R code.
n <- 50
p <- 5
X <- runif(n)
Z <- NULL
for (i in 1:p) {
Z <- cbind(Z, rbinom(n, 2, .3))
}
a <- 0.5
b <- rnorm(p)
e<- rnorm(n)
Y <- X*a + Z*b + e
library(nlme)
group=rep(1,n)
fit <- lme(Y~X, random=list(group=pdIdent(~-1+Z)))
VarCorr(fit)
However, when n and p increase, let's say n=1000 and p=500, the lme will be taking a long time to estimate two variances (variances of b and e). Is there a way to speed up?
Thanks a lot,
Best wishes,
Hung-Chih Ku
Postdoctoral fellow
UT Southwestern Medical Center
________________________________
UT Southwestern Medical Center
The future of medicine, today.
[[alternative HTML version deleted]]
More information about the R-sig-mixed-models
mailing list