modelPower: Calculate power for GLM tests

Description Usage Arguments Value Author(s) See Also Examples

Description

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.

Usage

1
2
modelPower(pc=NULL, pa=NULL, N=NULL, alpha=0.05, power=NULL, 
f2=NULL, peta2=NULL, dR2=NULL, R2=NULL)

Arguments

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

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

Value

Returns either power or N from analysis

Author(s)

John J. Curtin jjcurtin@wisc.edu

See Also

pwr.f2.test

Examples

1
2
modelPower(pc=3, pa=4, power=.90, peta2=.157)
modelPower(pc=1, pa=3, N=100, peta2=.157, alpha=.01)

Example output

Results from Power Analysis

pEta2 = 0.157
pa =     4 
pc =     3 
alpha = 0.050 

N = 60.408 
power = 0.900 
Results from Power Analysis

pEta2 = 0.157
pa =     3 
pc =     1 
alpha = 0.010 

N = 100.000 
power = 0.906 

lmSupport documentation built on May 2, 2019, 2:14 p.m.