R/statpsych1.R
ci.lc.stdmean.ws.Rd
Computes confidence intervals for two types of population standardized linear contrast of means (unweighted standardizer and level 1 standardizer) in a within-subjects design. Equality of variances is not assumed, but the correlations among the repeated measures are assumed to be approximately equal.
ci.lc.stdmean.ws(alpha, m, sd, cor, n, q)
alpha level for 1-alpha confidence
vector of within-subjects estimated means
vector of within-subjects estimated standard deviations
average estimated correlation of all measurement pairs
sample size
vector of within-subjects contrast coefficients
Returns a 2-row matrix. The columns are:
Estimate - bias adjusted standardized linear contrast
SE - standard error
LL - lower limit of the confidence interval
UL - upper limit of the confidence interval
Bonett DG (2008). “Confidence intervals for standardized linear contrasts of means.” Psychological Methods, 13(2), 99--109. ISSN 1939-1463, doi:10.1037/1082-989X.13.2.99 .
m <- c(33.5, 37.9, 38.0, 44.1)
sd <- c(3.84, 3.84, 3.65, 4.98)
q <- c(.5, .5, -.5, -.5)
ci.lc.stdmean.ws(.05, m, sd, .672, 20, q)
#> Estimate SE LL UL
#> Unweighted standardizer: -1.266557 0.2096351 -1.712140 -0.8903860
#> Level 1 standardizer: -1.337500 0.2662156 -1.915002 -0.8714561
# Should return:
# Estimate SE LL UL
# Unweighted standardizer: -1.266557 0.2096351 -1.712140 -0.8903860
# Level 1 standardizer: -1.337500 0.2662156 -1.915002 -0.8714561