Learn R Programming

powerMediation (version 0.3.4)

minEffect.SLR: Minimum detectable slope

Description

Calculate minimal detectable slope given sample size and power for simple linear regression.

Usage

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

Arguments

n

sample size.

power

power for testing if \(\lambda=0\) for 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_x\).

sigma.y

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

alpha

type I error rate.

verbose

logical. TRUE means printing minimum absolute detectable effect; FALSE means not printing minimum absolute detectable effect.

Value

lambda.a

minimum absolute detectable effect.

res.uniroot

results of optimization to find the optimal minimum absolute detectable effect.

Details

The test 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

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

Examples

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

Run the code above in your browser using DataLab