Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In
cohens_f()(R/eta_squared-main.R:340-355),generalized = generalizedis currently placed insideswitch(method, ...)instead of in thef(...)call:Because
methodis matched againstc("eta", "omega", "epsilon"), thegeneralizedbranch ofswitch()is unreachable andgeneralizedis silently dropped. Bothcohens_f(..., generalized = ...)andcohens_f_squared(..., generalized = ...)therefore return partial Cohen's f / f² instead of generalized Cohen's f / f².Proposed Changes
R/eta_squared-main.R: movegeneralized = generalizedout ofswitch(method, ...)into thef(...)call incohens_f().tests/testthat/test-eta_squared.R: add a regression test verifying thatcohens_f(mod, generalized = "cyl_f")andcohens_f_squared(mod, generalized = "cyl_f")matcheta2_to_f()/eta2_to_f2()applied toeta_squared(mod, generalized = "cyl_f")(both estimates and CI bounds).Minimal Reproducible Example
main):cohens_f(mod, generalized = "cyl_f")returnsCohen's f (partial):c(1.30, 1.38, 0.33)(ignoresgeneralized = "cyl_f").cohens_f(mod, generalized = "cyl_f")returns generalizedCohen's f:c(0.75, 1.31, 0.19), matchingeta2_to_f(eta_squared(mod, generalized = "cyl_f")$Eta2_generalized)(0.7497, 1.3136, 0.1912).Verification
testthat::test_file("tests/testthat/test-eta_squared.R"): all non-skipped tests passed (14 skipped due toskip_on_cran()/ optional suggested packages{afex},{lmerTest}), plus verifiedcohens_f(mod, method = "omega")andmethod = "epsilon"continue to work.R/eta_squared-main.R): 4 failures intest-eta_squared.R; restoringR/eta_squared-main.Rreturns to 0 failures.airstyle and checked withlintr(0 lints in touched lines).This PR was assisted by Gemini 4 Neon via Antigravity CLI; I have reviewed and verified the change.