easystats / easystats/performance
Cohen's f2 test
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 1.2k
- Forks
- 109
- Avg merge
- 6h 34m
- Merged PRs (30d)
- 8
Description
The formula here makes it look at is could be able to compare any nested models that have an R2. But should it be under test_wald(), or a separate test_f2()? The latter would make sense (as test_wald is quite limited), but then @mattansb said the p-value than for the former, so it's roughly equivalent?
m1 <- lm(mpg ~ ., data=mtcars)
m2 <- lm(mpg ~ cyl + vs, data=mtcars)
effectsize::cohens_f_squared(m1, model2 = m2)
#> Loading required namespace: performance
#> Cohen's f2 (partial) | 90% CI | R2_delta
#> ----------------------------------------------
#> 1.07 | [0.06, 1.79] | 0.14
performance::test_wald(m1, m2)
#> Name Model df df_diff F p
#> 1 m1 lm 21 NA NA NA
#> 2 m2 lm 29 -8 2.820169 0.02710374
Created on 2021-02-09 by the reprex package (v0.2.1)
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.
Research direction
Start with the linked effectsize Cohen's f documentation and the example calls to effectsize::cohens_f_squared() and performance::test_wald(). Determine whether Cohen's f2 belongs in test_wald() or needs a separate test_f2(), and clarify how its p-value should relate to the existing output. Done means the design decision and expected behavior are documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- analytics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100