[R] Extracting variance components from lmer

From: Rick DeShon <deshon_at_msu.edu>
Date: Tue 21 Feb 2006 - 01:57:02 EST


Hi All.

I need a bit of help extracting the residual error variance from the VarCorr structure from lmer.

#Here's a 2-way random effects model

lmer.1 <- lmer(rating ~ (1|person)+(1|rater), data = dat)

#Get the structure

vc.fit <- VarCorr(lmer.1)

#results in.....

$person
1 x 1 Matrix of class "dpoMatrix"

            (Intercept)
(Intercept) 0.7755392

$rater
1 x 1 Matrix of class "dpoMatrix"

            (Intercept)
(Intercept) 0.2054469

attr(,"sc")
[1] 0.5051518

#I can pull out the person and rater variance components easy enough. For
example...
vc.person <- vc.fit$person@x

I'm sure it's simple but I have not been able to grab the residual variance in the last matrix. I simply wish to asign the residual to a scalar variable. Any suggestions would be appreciated!

Thanks!

Rick DeShon

--
Rick DeShon
306 Psychology Building
Department of Psychology
Michigan State University
East Lansing, MI 48824-1116

	[[alternative HTML version deleted]]

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Tue Feb 21 02:02:27 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:42:36 EST