R- Partial eta squared for repeated measures ANOVA (car package)
Asked Answered
E

1

6

I have a 2-way repeated measures design (3 x 2), and I would like to get figures out how to calculate effect sizes (partial eta squared).

I have a matrix with data in it (called a) like so (repeated measures)

         A.a          A.b           B.a        B.b          C.a           C.b
1        514.0479     483.4246      541.1342   516.4149     595.5404      588.8000
2        569.0741     550.0809      569.7574   599.1509     621.4725      656.8136
3        738.2037     660.3058      812.2970   735.8543     767.0683      738.7920
4        627.1101     638.1338      641.2478   682.7028     694.3569      761.6241
5        599.3417     637.2846      599.4951   632.5684     626.4102      677.2634
6        655.1394     600.9598      729.3096   669.4189     728.8995      716.4605

idata =

    Caps    Lower
       A       a
       A       b
       B       a
       B       b
       C       a
       C       b

I know how to do a repeated measures ANOVA with the car package (type 3 SS is standard in my field although I know that it results in a logical error.. if somebody wants to explain that to me like I'm 5 I would love to understand it):

summary(Anova(lm(a ~ 1),
          idata=idata,type=3, 
          idesign=~Caps*Lower)),
    multivariate=FALSE)

I think what I want to do is take this part of the summary print out:

Univariate Type III Repeated-Measures ANOVA Assuming Sphericity

                     SS num Df Error SS den Df        F    Pr(>F)    
(Intercept)     14920141     1   153687      5 485.4072 3.577e-06 ***
Caps            33782        2     8770     10  19.2589  0.000372 ***
Lower           195          1    13887      5   0.0703  0.801451    
Caps:Lower      2481         2      907     10  13.6740  0.001376 ** 

And use it to calculate partial ETA squared. So, if I'm not mistaken, I need to take the SS from the first column and divide it by (itself + SS Error for that row) for each effect. Is this the correct way to go about it? If so, how do I do it? I can't figure out how to reference values from the summary print out.

Exon answered 31/7, 2013 at 3:58 Comment(3)
This may be better answered on Cross Validated.Rostellum
Have you checked etasq function in package heplots?Prolate
The cross-posted version on CV has been closed. Please, don't cross-post and ask a moderator to migrate your question for you when you feel it might be better served on another SE site.Alcus
P
8

The partial eta-squared can be calculated with the etasq function in heplots package

library(car)
mod <- Anova(lm(a ~ 1),
idata = idata,
type = 3,
idesign = ~Caps*Lower)

mod

library(heplots)
etasq(mod, anova = TRUE)

Since you are asking about the calculations:
From ?etasq: 'For univariate linear models, classical η^2 = SSH / SST and partial η^2 = SSH / (SSH + SSE). These are identical in one-way designs.'.

If you wish to inspect the code for the calculations of η^2 for a model with a class as in the example, you may use getS3method(f = "etasq", class = "Anova.mlm").

Prolate answered 6/8, 2013 at 23:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.