Learn R Programming

statpsych (version 1.7.0)

size.test.mean: Sample size for a test of a mean

Description

Computes the sample size required to test a single population mean with desired power in a 1-group design. Set the variance planning value to the largest value within a plausible range for a conservatively large sample size.

Usage

size.test.mean(alpha, pow, var, es)

Value

Returns the required sample size

Arguments

alpha

alpha level for hypothesis test

pow

desired power

var

planning value of response variable variance

es

planning value of mean minus null hypothesis value

Examples

Run this code
size.test.mean(.05, .9, 80.5, 7)

# Should return:
# Sample size
#          20
 

Run the code above in your browser using DataLab