Skip to content

lmer (lme4): % total variance explained by random effect

6 messages · Katharina May, Liliana Martinez, Reinhold Kliegl +1 more

#
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>:

  
    
#
There is a recent paper that may give you a start on why this is a
difficult question.

Edwards, L.J. et al. (2008). An R2 statistic for fixed effects in the
linear mixed model.
Statistics in Medicine, 27, 6137-6157.
DOI: 10.1002/sim.3429

Reinhold Kliegl
On Sun, Aug 2, 2009 at 11:27 PM, Liliana Martinez<ltiana_m at yahoo.com> wrote:
#
Hi,

great thanks for answering me: now I understand why my question was rather a
bit "naive" in a way....


-Katharina

2009/8/3 Reinhold Kliegl <reinhold.kliegl at gmail.com>:

  
    
#
Hi Katharina,

The difficulty with random intercept-slope models is that they  
(usually) give rise to a non-constant variance across the range of the  
covariate. This means that the percentage of variance explained will  
depend on which value of the covariate you evaluate.

If you extract the (co)variance matrix for the intercept-slopes:

V<-VarCorr(name_of_model)$name_of_random_effect

and then set up a design matrix with ones in the first column, and a  
set of covariate values in the second:

Z<-cbind(rep(1,100), seq(-1,1,length=100))

then

M<-diag(Z%*%V%*%t(Z))

is equal to the variance explained by the random effect for each value  
of the covariate.  If there are no other effects M/(M+Ve) gives you  
the proportion explained where Ve is the residual variance.

Hope this helps,

Jarrod
On 2 Aug 2009, at 16:23, Katharina May wrote:

            

  
    
6 days later
#
Oh yes, now I get the picture, thanks a lot!
as the variance explained by the random effect for each value of the
covariate is (luckely) more or less similar within my data, I will
take the mean to have an approximation..

Thank you very much,

               -Katharina

2009/8/3 Jarrod Hadfield <j.hadfield at ed.ac.uk>: