Wrapper to calculate power for tests of paramter estimates or full model in GLM based on Cohen's tables and using pwr.f2.test in pwr packag. Allows 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. You must specify 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.
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
f2 effect size
peta2
partial eta2 effect size
dR2
delta R2 effect size; if provided must also specify R2
R2
Model R2, only need if using Delta R2 as effect size