Description Usage Arguments Value Examples
Wrapper to calculate power for tests of parameter estimates or full model in GLM based on Cohen's tables and using pwr.f2.test in pwr package. Inspired by modelPower in John Curtin's lmSupport package. Allows the use of partial eta squared or delta R2 rather than just f2 as effect size. If you provide power, it returns N, if you provide N, it returns power. If you provide N and power, it returns the minimum detectable effect size given the specified N and power. You must alwasy specify an effect size as either f2, partial eta2, or delta R2 with model R2. You must also specify the number of parameters in the compact (pc) and augmented (pa) for the model comparison that will test the effect.
1 2 3 4 5 6 7 8 9 10 11 |
pc |
Number of parameters in the compact model; i.e., intercept + all parameters excluding the effect of interest; This is the numerator df of the F test for the effect. |
pa |
Number of parameters in the augmented model; i.e., the intercept and all parameters including the effect of interest. |
n |
Sample size. |
alpha |
Alpha for statistical test. |
power |
Power for statistical test. |
f2 |
Effect size. |
peta2 |
= Partial eta2 effect size. |
dr2 |
Delta r2 effect; if provided must also specify r2. |
r2 |
Model r2, only needed if using delta r2. |
Returns a list with n, power, possibly minimum detectable effect size.
1 2 3 4 5 6 7 8 9 10 11 | # return the minimum detectable effect size with 200 participants, power of
# .8 (the default), pa of 5, and pc of 4:
power_analysis(pa = 5, pc = 4, n = 200)
# return the number of participants needed for 70% power given
# pa of 3, pc of 2, and peta2 of .01
power_analysis(pa = 3, pc = 2, peta2 = .01, power = .7)
# return the power of a study with peta2 of .02 and 50 participants, with
# pa of 5 and pc of 4.
power_analysis(pa = 5, pc = 4, peta2 = .02, n = 50)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.