R/statpsych1.R
size.ci.mean.prior.Rd
Computes the sample size required to estimate a population mean with desired confidence interval precision in applications where an estimated variance from a prior study is available. The actual confidence interval width in the planned study will depend on the value of the estimated variance in the planned study. An estimated variance from a prior study is used to predict the value of the estimated correlation in the planned study, and the predicted variance estimate is then used in the sample size computation.
This sample size approach assumes that the population variance in the prior study is very similar to the population variance 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 variance that will be observed in the planned study. The size.ci.mean) function uses a variance planning value that is based on expert opinion regarding the likely value of the variance estimate that will be observed in the planned study.
size.ci.mean.prior(alpha1, alpha2, var0, n0, w)
alpha level for 1-alpha1 confidence in the planned study
alpha level for the 1-alpha2 prediction interval
estimated variance in prior study
sample size in prior study
desired confidence interval width
Returns the required sample size
size.ci.mean.prior(.05, .10, 26.4, 25, 4)
#> Sample size
#> 44
# Should return:
# Sample size
# 44