View source: R/ss.power.reg.coef.R
ss.power.reg.coef | R Documentation |
Determine the necessary sample size for a targeted regression coefficient or determine the degree of power given a specified sample size
ss.power.reg.coef(Rho2.Y_X = NULL, Rho2.Y_X.without.j = NULL, p = NULL,
desired.power = 0.85, alpha.level = 0.05, Directional = FALSE,
beta.j = NULL, sigma.X = NULL, sigma.Y = NULL, Rho2.j_X.without.j = NULL,
RHO.XX = NULL, Rho.YX = NULL, which.predictor = NULL, Cohen.f2 = NULL,
Specified.N=NULL, Print.Progress = FALSE)
Rho2.Y_X |
population squared multiple correlation coefficient predicting the dependent variable (i.e., Y) from the |
Rho2.Y_X.without.j |
population squared multiple correlation coefficient predicting the dependent variable (i.e., Y) from the |
p |
number of predictor variables |
desired.power |
desired degree of statistical power for the test of targeted regression coefficient |
alpha.level |
Type I error rate |
Directional |
whether or not a direction or a nondirectional test is to be used (usually |
beta.j |
population value of the regression coefficient for the predictor of interest |
sigma.X |
population standard deviation for the predictor variable of interest |
sigma.Y |
population standard deviation for the outcome variable |
Rho2.j_X.without.j |
population squared multiple correlation coefficient predicting the predictor variable of interest from the remaining p-1 predictor variables |
RHO.XX |
population correlation matrix for the |
Rho.YX |
population vector of correlation coefficient between the |
Cohen.f2 |
Cohen's (1988) definition for an effect size for a targeted regression coefficient: |
which.predictor |
identifies the predictor of interest when |
Specified.N |
sample size for which power should be evaluated |
Print.Progress |
if the progress of the iterative procedure is printed to the screen as the iterations are occurring |
Determines the necessary sample size given a desired level of statistical power. Alternatively, determines the statistical power for a given a specified sample size.
There are a number of ways that the specification regarding the size of the regression coefficient can be entered. The most basic, and often the simplest, is to specify Rho2.Y_X
and Rho2.Y_X.without.j
. See the examples section
for several options.
Sample.Size |
either the necessary sample size or the specified sample size, depending if one is interested in determining the necessary sample size given a desired degree of statistical power or if one is interested in the determining the value of statistical power given a specified sample size, respectively |
Actual.Power |
Actual power of the situation described |
Noncentral.t.Parm |
value of the noncentral distribution for the appropriate t-distribution |
Effect.Size.NC.t |
effect size for the noncentral t-distribution; this is the square root of |
Ken Kelley (University of Notre Dame; KKelley@ND.Edu)
Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Hillsdale, NJ: Erlbaum.
Kelley, K. & Maxwell, S. E. (2008). Sample Size Planning with applications to multiple regression: Power and accuracy for omnibus and targeted effects. In P. Alasuuta, J. Brannen, & L. Bickman (Eds.), The Sage handbook of social research methods (pp. 166–192). Newbury Park, CA: Sage.
Maxwell, S. E. (2000). Sample size for multiple regression. Psychological Methods, 4, 434–458.
ss.aipe.reg.coef
, ss.power.R2
, conf.limits.ncf
Cor.Mat <- rbind(
c(1.00, 0.53, 0.58, 0.60, 0.46, 0.66),
c(0.53, 1.00, 0.35, 0.07, 0.14, 0.43),
c(0.58, 0.35, 1.00, 0.18, 0.29, 0.50),
c(0.60, 0.07, 0.18, 1.00, 0.30, 0.26),
c(0.46, 0.14, 0.29, 0.30, 1.00, 0.30),
c(0.66, 0.43, 0.50, 0.26, 0.30, 1.00))
RHO.XX <- Cor.Mat[2:6,2:6]
Rho.YX <- Cor.Mat[1,2:6]
# Method 1
# ss.power.reg.coef(Rho2.Y_X=0.7826786, Rho2.Y_X.without.j=0.7363697, p=5,
# alpha.level=.05, Directional=FALSE, desired.power=.80)
# Method 2
# ss.power.reg.coef(alpha.level=.05, RHO.XX=RHO.XX, Rho.YX=Rho.YX,
# which.predictor=5,
# Directional=FALSE, desired.power=.80)
# Method 3
# Here, beta.j is the standardized regression coefficient. Had beta.j
# been the unstandardized regression coefficient, sigma.X and sigma.Y
# would have been the standard deviation for the
# X variable of interest and Y, respectively.
# ss.power.reg.coef(Rho2.Y_X=0.7826786, Rho2.j_X.without.j=0.3652136,
# beta.j=0.2700964,
# p=5, alpha.level=.05, sigma.X=1, sigma.Y=1, Directional=FALSE,
# desired.power=.80)
# Method 4
# ss.power.reg.coef(alpha.level=.05, Cohen.f2=0.2130898, p=5,
# Directional=FALSE,
# desired.power=.80)
# Power given a specified N and squared multiple correlation coefficients.
# ss.power.reg.coef(Rho2.Y_X=0.7826786, Rho2.Y_X.without.j=0.7363697,
# Specified.N=25,
# p=5, alpha.level=.05, Directional=FALSE)
# Power given a specified N and effect size.
# ss.power.reg.coef(alpha.level=.05, Cohen.f2=0.2130898, p=5, Specified.N=25,
# Directional=FALSE)
# Reproducing Maxwell's (2000, p. 445) Example
Cor.Mat.Maxwell <- rbind(
c(1.00, 0.35, 0.20, 0.20, 0.20, 0.20),
c(0.35, 1.00, 0.40, 0.40, 0.40, 0.40),
c(0.20, 0.40, 1.00, 0.45, 0.45, 0.45),
c(0.20, 0.40, 0.45, 1.00, 0.45, 0.45),
c(0.20, 0.40, 0.45, 0.45, 1.00, 0.45),
c(0.20, 0.40, 0.45, 0.45, 0.45, 1.00))
RHO.XX.Maxwell <- Cor.Mat.Maxwell[2:6,2:6]
Rho.YX.Maxwell <- Cor.Mat.Maxwell[1,2:6]
R2.Maxwell <- Rho.YX.Maxwell
RHO.XX.Maxwell.no.1 <- Cor.Mat.Maxwell[3:6,3:6]
Rho.YX.Maxwell.no.1 <- Cor.Mat.Maxwell[1,3:6]
R2.Maxwell.no.1 <-
Rho.YX.Maxwell.no.1
# Note that Maxwell arrives at N=113, whereas this procedure arrives at 111.
# This seems to be the case becuase of rounding error in calculations
# in Cohen (1988)'s tables. The present procedure is correct and contains no
# rounding error
# in the application of the method.
# ss.power.reg.coef(Rho2.Y_X=R2.Maxwell,
# Rho2.Y_X.without.j=R2.Maxwell.no.1, p=5,
# alpha.level=.05, Directional=FALSE, desired.power=.80)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.