Learn R Programming

statpsych (version 1.7.0)

size.test.slope.gen: Sample size for a slope hypothesis test in a general statistical model

Description

Computes the sample size required to test a null hypothesis with desired power that a population slope coefficient in any general statistical is equal to zero. This function requires a standard error estimate for the slope of interest from a prior or pilot study and the sample size that was used in the prior or pilot study.

Usage

size.test.slope.gen(alpha, pow, se, n0, b)

Value

Returns the required sample size

Arguments

alpha

alpha level for 1-alpha confidence

pow

desired power

se

standard error of slope from prior/pilot study

n0

sample size used in prior/pilot study

b

planning value of population slope

Examples

Run this code
size.test.slope.gen(.05, .8, 3.15, 50, 5)

# Should return:
#  Sample size
#          156
 

Run the code above in your browser using DataLab