[R] Variance explained in mixed models
HDoran at air.org
Fri Aug 31 15:47:22 CEST 2007
Ahh, the key to getting what you want is to ask the same question over
and over again. This question is not about R and an answer can be found
in all basic books on hierarchical linear models.
> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Simon Pickett
> Sent: Friday, August 31, 2007 9:43 AM
> To: r-help at stat.math.ethz.ch
> Subject: [R] Variance explained in mixed models
> I realise this has come up before in various reincarnations
> but I couldnt find the answer...
> I wish to quote the "percentage variance explained" by each
> of three components in my mixed model, one random effect and
> two fixed effects.
> lmer(response~x1+x2+(1|random), data=data)
> Using lmer I can get the variance explained by the random
> effect but not the fixed effects obviously.
> I was using a suggestion by someone that you can compare the
> variance components of the model with with both fixed terms
> included, with another model that has one of the fixed terms
> removed. When I did this the Variance + residual variance did
> not add up to the same figure each time.
> #first model with both fixed terms
> Variance StdDev
> (Intercept) 1.074666 1.036661
> Residual 1.136264 1.065957
> #second model with one term ommitted
> Variance StdDev
> (Intercept) 1.113713 1.055326
> Residual 1.154527 1.074489
> #third model with the other term ommitted Variance StdDev
> (Intercept) 1.069478 1.034156
> Residual 1.145590 1.070322
> Actually the second model with only one fixed effect is
> saying that the percentage variance explained is higher than
> the one with both fixed effects which is impossible right?
> Any better ideas?
> Thanks in advance, Simon.
> Simon Pickett
> PhD student
> Centre For Ecology and Conservation
> Tremough Campus
> University of Exeter in Cornwall
> Tel 01326371852
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help