slr: Power calculation for a simple linear regression
Description
Performs sample size and power calculations for a simple linear regression.
Can solve for power, N or alpha. Required inputs include the values of the
slope regression coefficient under the null hypothesis and the alternative,
the variance of the covariate X, and the SD of the error. Power calculations
for a simple linear regression can also be conducted using the mlrF.overall function,
which requires fewer inputs.
Usage
slr(
N = NULL,
beta10 = 0,
beta1A = NULL,
var.x = NULL,
sigma.e = NULL,
alpha = 0.05,
power = NULL,
sides = 2,
v = FALSE
)
Value
A list of the arguments (including the computed one).
Arguments
N
The sample size.
beta10
The slope regression coefficient under the null hypothesis; defaults to 0.
beta1A
The slope regression coefficient under the alternative hypothesis.
var.x
The variance of the covariate X.
sigma.e
The standard deviation of the error terms.
alpha
The significance level (type 1 error rate); defaults to 0.05.
power
The specified level of power.
sides
Either 1 or 2 (default) to specify a one- or two- sided hypothesis test.
v
Either TRUE for verbose output or FALSE (default) to output computed argument only.