effectsize icon indicating copy to clipboard operation
effectsize copied to clipboard

Allow extra argument type=1, 2 or 3 for eta_squared function & change default to type=2

Open tomwenseleers opened this issue 1 year ago • 7 comments

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)

tomwenseleers avatar Oct 24 '22 08:10 tomwenseleers