Describe the solution you'd like
The current eta_squared function appears to return partial eta squared values based on type I SS. It is generally reckoned those are not very useful for factorial designs or models with interaction effects. It also leads to confusion, as the partial eta squared values of different packages have different defaults & options in this respect, sometimes using type I SS and sometimes type II or III, https://stats.stackexchange.com/questions/552451/which-r-functions-are-correct-for-estimating-partial-eta-squared-for-effects-in. At the very least an extra argument type=XX would seem to be in order, as in the DescTools::EtaSq function.
How could we do it?
To get partial eta squared values using type I, II or III SS I figured that with the effectsize::eta_squared function one would have to do
effectsize::eta_squared(fit) or equivalently effectsize::eta_squared(anova(fit)) # using type I tests
effectsize::eta_squared(car::Anova(fit, type=2)) # using type II tests
effectsize::eta_squared(car::Anova(fit, type=3)) # using type III tests, requires using effect coding / sum contrasts, cf afex::set_sum_contrasts() and all continuous covariates need to be centered using scale()
It would be nice if these could be obtained using effectsize::eta_squared(fit, type=1, 2 or 3)
Describe the solution you'd like
The current
eta_squaredfunction appears to return partial eta squared values based on type I SS. It is generally reckoned those are not very useful for factorial designs or models with interaction effects. It also leads to confusion, as the partial eta squared values of different packages have different defaults & options in this respect, sometimes using type I SS and sometimes type II or III, https://stats.stackexchange.com/questions/552451/which-r-functions-are-correct-for-estimating-partial-eta-squared-for-effects-in. At the very least an extra argumenttype=XXwould seem to be in order, as in theDescTools::EtaSqfunction.How could we do it?
To get partial eta squared values using type I, II or III SS I figured that with the
effectsize::eta_squaredfunction one would have to doeffectsize::eta_squared(fit)or equivalentlyeffectsize::eta_squared(anova(fit)) # using type I testseffectsize::eta_squared(car::Anova(fit, type=2)) # using type II testseffectsize::eta_squared(car::Anova(fit, type=3)) # using type III tests, requires using effect coding / sum contrasts, cf afex::set_sum_contrasts() and all continuous covariates need to be centered using scale()It would be nice if these could be obtained using
effectsize::eta_squared(fit, type=1, 2 or 3)