extracting variance components in lme4?
Douglas Bates wrote:
On 2/6/07, Fabian Scheipl <f.abian at gmx.net> wrote:
try
vc <-VarCorr( model1 )
varcomps<-c(unlist( lapply(vc, diag) ), # random intercept variances
attr(vc,"sc")^2) # residual variance
also works if you have multiple random terms (intercept and slope, e.g.) for a given grouping factor.
Extracts the respective variances without the covariances.
Yes, indeed. That is better than the version that I suggested. Thanks. If a good name for such an extractor can be suggested I will incorporate it in the lme4 package. Any suggestions for a name?
How about VarComp (for Variance Components)?
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
J?r?me GOUDET Dep. Ecology & Evolution Biophore, UNIL-Sorge UNIL-CH-1015 Lausanne Switzerland http://www.unil.ch/dee http://www.unil.ch/popgen Tel: +41 21 692 42 42 Fax: +41 21 692 42 65 Secr:+41 21 692 42 60 jerome.goudet at unil.ch