2
$\begingroup$

I need to estimate effect size estimation of each independent variable in linear mixed model regression.

Here is a code:

library(lme4)
library(MASS)
library(sjstats)
data(oats)
names(oats) = c('block', 'variety', 'nitrogen', 'yield')
oats$mainplot = oats$variety
oats$subplot = oats$nitrogen

m1.lme4 = lmer(yield ~ variety + nitrogen + (1|block/mainplot),
               data = oats)
summary(m1.lme4)

eta_sq(m1.lme4, partial = TRUE, n = 10000)
omega_sq(m1.lme4, partial = TRUE, n = 10000)

output:

Linear mixed model fit by REML ['lmerMod']
Formula: yield ~ variety + nitrogen + (1 | block/mainplot)
   Data: oats

REML criterion at convergence: 568.1

Scaled residuals: 
     Min       1Q   Median       3Q      Max 
-1.84135 -0.66280 -0.06694  0.63822  1.66067 

Random effects:
 Groups         Name        Variance Std.Dev.
 mainplot:block (Intercept) 109.7    10.47   
 block          (Intercept) 214.5    14.65   
 Residual                   162.6    12.75   
Number of obs: 72, groups:  mainplot:block, 18; block, 6

Fixed effects:
                  Estimate Std. Error t value
(Intercept)         79.917      8.220   9.722
varietyMarvellous    5.292      7.079   0.748
varietyVictory      -6.875      7.079  -0.971
nitrogen0.2cwt      19.500      4.250   4.588
nitrogen0.4cwt      34.833      4.250   8.196
nitrogen0.6cwt      44.000      4.250  10.353

Correlation of Fixed Effects:
            (Intr) vrtyMr vrtyVc ntr0.2 ntr0.4
vartyMrvlls -0.431                            
varityVctry -0.431  0.500                     
ntrgn0.2cwt -0.259  0.000  0.000              
ntrgn0.4cwt -0.259  0.000  0.000  0.500       
ntrgn0.6cwt -0.259  0.000  0.000  0.500  0.500
> 
> eta_sq(m1.lme4, partial = TRUE, n = 10000)
      term partial.etasq
1  variety         0.052
2 nitrogen         0.695
> omega_sq(m1.lme4, partial = TRUE, n = 10000)
      term partial.omegasq
1  variety           0.026
2 nitrogen           0.688

It gives me partial eta squired and partial omega squared, but:

  1. This web page says that you can use eta squared in regression. Is it valid to use partial eta and/or omega squared for effect size estimation of each independent variable in linear mixed model regression?
  2. If answer to question 1 is "yes": The documentation from sjstats package talks only about use of partial eta and/or partial omega squared for ANOVA but not about other models. But if I give it mixed model it gives me result. Is that result valid?
$\endgroup$
1
$\begingroup$

Unless the sjstats eta_sq / omega_sq take into account the random effects (or more particularly, the variance of the random effects), I would say that is method may not be valid.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.