# [R-sig-ME] lmer (lme4): % total variance explained by random effect

Katharina May may.katharina at googlemail.com
Sun Aug 2 17:23:38 CEST 2009

```Hi,

just out of curiosity because nobody is answering:
is it not not possible to calculate the variance described by a random
effect on slope and intercept as percentage of the total variance
(variance of random effect + unexplained variance)?

Would be more than happy if somebody can help me...

Thanks,

Katharina

2009/7/24 Katharina May <may.katharina at googlemail.com>:
> Hello,
>
> just to say sorry if this questions may be somewhat "inappropriate": I'm a
> bachelor student,
> recently started with R and with trying to understand mixed models, but I'm
> somewhat stuck with
> the following problem and hope somebody might be able to help me finding a
> solution:
>
> How can I get the variance (in % of the total variance) which is explained
> by the random effect (both on slope
> and intercept together)?
> My aim is to say something like xx% of the variance is explained by the
> random effect...
>
> As I'm not sure how to deal with this I would be more than happy for any
> hints...
>
> Thank you very much and With Best Wishes from Freising/Germany,
>
>                         Katharina
>
>
>
> here an example output of a mixed model I use with 1 random effect on both
> slope and intercept,
> fitted with method=ML:
>
>
> Linear mixed model fit by maximum likelihood
> Formula: log(AGB) ~ log(BM_roots) + (log(BM_roots) |
> as.factor(biomass_data[which(biomass_data\$woody ==      1), 2]))
>    Data: biomass_data[which(biomass_data\$woody == 1), ]
>    AIC   BIC logLik deviance REMLdev
>  588.6 619.6 -288.3    576.6     583
> Random effects:
>  Groups                                                     Name
>                          Variance   Std.Dev.   Corr
>  as.factor(biomass_data[which(biomass_data\$woody == 1), 2]) (Intercept)
> 1.7568529  1.325463
>                                                             log(BM_roots)
>                           0.0071313  0.084447  -0.393
>  Residual
> 0.0809467 0.284511
> Number of obs: 1282, groups: as.factor(biomass_data[which(biomass_data\$woody
> == 1), 2]), 22
>
> Fixed effects:
>               Estimate Std. Error t value
> (Intercept)    1.33062    0.29669    4.48
> log(BM_roots)  0.93182    0.02441   38.17
>
> Correlation of Fixed Effects:
>             (Intr)
> log(BM_rts) -0.446
>
>

--
Time flies like an arrow, fruit flies like bananas.

```