[R-sig-ME] extracting variance components in lme4?
f.abian at gmx.net
Tue Feb 6 15:09:37 CET 2007
I'd suggest getVarComps() for its close analogy to nlme::getVarCov()...
> 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?
More information about the R-sig-mixed-models