Learn R Programming

statpsych (version 2.0.0)

size.test.cor: Sample size for a test of a Pearson or partial correlation

Description

Computes the sample size required to test a population Pearson or a partial correlation with desired power. Set s = 0 for a Pearson correlation.

For more details, see Section 1.25 of Bonett (2021, Volume 2)

Usage

size.test.cor(alpha, pow, cor, s, h)

Value

Returns the required sample size

Arguments

alpha

alpha level for hypothesis test

pow

desired power

cor

planning value of correlation

s

number of control variables

h

null hypothesis value of correlation

References

Bonett2021statpsych

Examples

Run this code
size.test.cor(.05, .95, -.50, 0, 0)

# Should return:
# Sample size
#          47

size.test.cor(.05, .90, .4, 2, 0)

# Should return:
# Sample size
#          64
 

Run the code above in your browser using DataLab