Sample size for a within-subjects mean linear contrast confidence interval
Source:R/statpsych1.R
size.ci.lc.mean.ws.RdComputes the sample size required to estimate a linear contrast of population means with desired confidence interval precision in a within-subjects design. Set the variance planning value to the largest value within a plausible range for a conservatively large sample size. Set the Pearson correlation planning value to the smallest value within a plausible range for a conservatively large sample size.
For more details, see Section 4.26 of Bonett (2021, Volume 1)
References
Bonett DG (2021). Statistical Methods for Psychologists https://dgbonett.sites.ucsc.edu/.
Examples
q <- c(.5, .5, -.5, -.5)
size.ci.lc.mean.ws(.05, 161.9, .77, 4, q)
#> Sample size
#> 38
# Should return:
# Sample size
# 38