Learn R Programming

statpsych (version 1.7.0)

size.ci.cor: Sample size for a Pearson or partial correlation confidence interval

Description

Computes the sample size required to estimate a population Pearson or partial correlation with desired confidence interval precision. Set s = 0 for a Pearson correlation. Set the correlation planning value to the smallest absolute value within a plausible range for a conservatively large sample size.

Usage

size.ci.cor(alpha, cor, s, w)

Value

Returns the required sample size

Arguments

alpha

alpha level for 1-alpha confidence

cor

planning value of correlation

s

number of control variables

w

desired confidence interval width

References

Bonett2000statpsych

Examples

Run this code
size.ci.cor(.05, .362, 0, .25)

# Should return:
# Sample size
#         188
 

Run the code above in your browser using DataLab