Re: [Rd] mixed effects model and r-squared

From: Ben Bolker <>
Date: Fri 08 Dec 2006 - 14:34:47 GMT

Indermaur Lukas <Lukas.Indermaur <at>> writes:

> Heya
> I am fitting linear mixed effects model in R [snip]
> ts.model <- lme(LOG_FOC_MW ~ R_DN_SUM + ANIMAL + SEX+ YY, data =,
random = ~ 1 | ANIMAL,
> correlation=corCAR1(0.2, form = ~1 | ANIMAL ),
method='ML', na.action=na.omit)).
> Is there a possability to easly compute an R-square
from the output of the
model summary?
> I would appreciate any hint.
> Best regards
> Lukas

  You probably need to repost this on r-help instead of r-devel; it's not a "development" question.

   The other bad news for you is that I suspect it may be difficult to define r-squared uniquely for a mixed model. The resid() command will give you
residuals, and you could take (1-resid()^2)/var(x) -- but how do you decide which var(x) to put in the denominator ... ?

  Ben Bolker mailing list Received on Sat Dec 09 01:47:54 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 08 Dec 2006 - 15:30:50 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.