Learn R Programming

statpsych (version 1.7.0)

size.ci.cor.prior: Sample size for a Pearson correlation confidence interval using a planning value from a prior study

Description

Computes the sample size required to estimate a Pearson correlation with desired confidence interval precision in applications where an estimated Pearson correlation from a prior study is available. The actual confidence interval width in the planned study will depend on the value of the estimated correlation in the planned study. An estimated correlation from a prior study is used to predict the value of the estimated correlation in the planned study, and the predicted correlation estimate is then used in the sample size computation.

This sample size approach assumes that the population Pearson correlation in the prior study is very similar to the population Pearson correlation in the planned study. In a typical sample size analysis, this type of information is not available, and the researcher must use expert opinion to guess the value of the Pearson correlation that will be observed in the planned study. The size.ci.cor function uses a correlation planning value that is based on expert opinion regarding the likely value of the correlation estimate that will be observed in the planned study.

Usage

size.ci.cor.prior(alpha1, alpha2, cor0, n0, w)

Value

Returns the required sample size

Arguments

alpha1

alpha level for 1-alpha1 confidence in the planned study

alpha2

alpha level for the 1-alpha2 prediction interval

cor0

estimated correlation in prior study

n0

sample size in prior study

w

desired confidence interval width

Examples

Run this code
size.ci.cor.prior(.05, .10, .438, 100, .2)

# Should return:
# Sample size
#         331


Run the code above in your browser using DataLab