Converts Cohen's f to partial eta squared (\(\eta_p^2\)) using the standard definition in Cohen (1988).
Details
The conversion is defined as: $$\eta_p^2 = \frac{f^2}{1 + f^2}$$
This follows from the relationship: \(f = \sqrt{\eta_p^2 / (1 - \eta_p^2)}\)
References
Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Hillsdale, NJ: Lawrence Erlbaum Associates.
Examples
# Convert a single Cohen's f value
cohensf_to_peta2(0.25)
#> [1] 0.05882353
# Convert multiple values
cohensf_to_peta2(c(0.1, 0.25, 0.4))
#> [1] 0.00990099 0.05882353 0.13793103