easystats / easystats/effectsize
Allow extra argument type=1, 2 or 3 for eta_squared function & change default to type=2
@mattansb is already working on this.
Since Oct 27, 2022.
- Dominant language
- R
- Stars
- 353
- Forks
- 25
- Avg merge
- 9h 21m
- Merged PRs (30d)
- 1
Description
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)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.