Learn R Programming

powerMediation (version 0.3.4)

power.SLR: Power for testing slope for simple linear regression

Description

Calculate power for testing slope for simple linear regression.

Usage

power.SLR(n, 
          lambda.a, 
          sigma.x, 
          sigma.y, 
          alpha = 0.05, 
          verbose = TRUE)

Arguments

n

sample size.

lambda.a

regression coefficient in the simple linear regression \(y_i=\gamma+\lambda x_i + \epsilon_i, \epsilon_i\sim N(0, \sigma_{e}^2).\)

sigma.x

standard deviation of the predictor \(sd(x)\).

sigma.y

marginal standard deviation of the outcome \(sd(y)\). (not the marginal standard deviation \(sd(y|x)\))

alpha

type I error rate.

verbose

logical. TRUE means printing power; FALSE means not printing power.

Value

power

power for testing if \(b_2=0\).

delta

\(\lambda\sigma_x\sqrt{n}/\sqrt{\sigma_y^2-(\lambda\sigma_x)^2}\).

s

\(\sqrt{\sigma_y^2-(\lambda\sigma_x)^2}\).

t.cr

\(\Phi^{-1}(1-\alpha/2)\), where \(\Phi\) is the cumulative distribution function of the standard normal distribution.

rho

correlation between the predictor \(x\) and outcome \(y\) \(=\lambda\sigma_x/\sigma_y\).

Details

The power is for testing the null hypothesis \(\lambda=0\) versus the alternative hypothesis \(\lambda\neq 0\) for the simple linear regressions: $$y_i=\gamma+\lambda x_i + \epsilon_i, \epsilon_i\sim N(0, \sigma^2_{e})$$

References

Dupont, W.D. and Plummer, W.D.. Power and Sample Size Calculations for Studies Involving Linear Regression. Controlled Clinical Trials. 1998;19:589-601.

See Also

minEffect.SLR, power.SLR.rho, ss.SLR.rho, ss.SLR.

Examples

Run this code
# NOT RUN {
  power.SLR(n=100, lambda.a=0.8, sigma.x=0.2, sigma.y=0.5, 
    alpha = 0.05, verbose = TRUE)

# }

Run the code above in your browser using DataLab