-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
η²p for ANOVA repeated measures #406
Comments
Originally, I couldn't figure out how to get the raw SS out of an But I see that I already solved this elsewhere but just didn't export the function... So now I've taken care of that (: ds <- data.frame(I = c(116, 96, 120, 110, 116, 126, 86, 80),
II = c(76, 93, 112, 113, 75, 120, 90, 105),
III = c(85, 63, 89, 60, 115, 101, 129, 67),
IV = c(50, 87, 100, 60, 79, 70, 65, 65),
id = 1:8)
ds_long <- data.frame(
id = c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L,
1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L,
1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L,
1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L),
ind_var = c("I", "I", "I", "I", "I", "I", "I", "I",
"II", "II", "II", "II", "II", "II", "II", "II",
"III", "III", "III", "III", "III", "III", "III", "III",
"IV", "IV", "IV", "IV", "IV", "IV", "IV", "IV"),
score = c(116, 96, 120, 110, 116, 126, 86, 80,
76, 93, 112, 113, 75, 120, 90, 105,
85, 63, 89, 60, 115, 101, 129, 67,
50, 87, 100, 60, 79, 70, 65, 65)
)
# Car -----
fit <- lm(cbind(I, II, III, IV) ~ 1, data = ds)
in_rep <- data.frame(ind_var = gl(4, 1))
car::Anova(fit, idata = in_rep, idesign = ~ ind_var) |>
effectsize::eta_squared(ci = NULL)
#> Note: model has only an intercept; equivalent type-III tests substituted.
#> Warning in summary.Anova.mlm(model): HF eps > 1 treated as 1
#> # Effect Size for ANOVA (Type III)
#>
#> Parameter | Eta2 (partial)
#> --------------------------
#> ind_var | 0.41
afex::aov_ez(id = 'id',
dv = 'score',
data = ds_long,
within = 'ind_var',
anova_table = list(es = "pes"))
#> Anova Table (Type 3 tests)
#>
#> Response: score
#> Effect df MSE F pes p.value
#> 1 ind_var 2.22, 15.52 481.55 4.86 * .410 .021
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
#>
#> Sphericity correction method: GG Created on 2022-01-14 by the reprex package (v2.0.1) |
Excellent! When will you upload that change to the package? |
Already on the main branch of Github |
I am puzzled on how
etasquared()
is working with car objects for repeated designs:Created on 2022-01-14 by the reprex package (v2.0.1)
The same data, the same analysis, the same SS... but totally different results. I made it by hand and the second approach (ez object) is correct.
PS: I am aware that the Generalized η² might be more adequate to repeated measures designs. With the first approach is not possible to produce it using
generalized =T
but with the second one, yes.The text was updated successfully, but these errors were encountered: