R/statpsych1.R
ci.2x2.stdmean.ws.Rd
Computes confidence intervals for standardized linear contrasts of means (AB interaction, main effect of A, main effect of B, simple main effects of A, and simple main effects of B) in a 2x2 within-subjects design. Equality of population variances is not assumed. An unweighted variance standardizer is used.
ci.2x2.stdmean.ws(alpha, y11, y12, y21, y22)
alpha level for 1-alpha confidence
vector of scores at level 1 of A and level 1 of B
vector of scores at level 1 of A and level 2 of B
vector of scores at level 2 of A and level 1 of B
vector of scores at level 2 of A and level 2 of B
Returns a 7-row matrix (one row per effect). The columns are:
Estimate - estimated standardized effect
adj Estimate - bias adjusted standardized effect estimate
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 .
y11 <- c(21, 39, 32, 29, 27, 17, 27, 21, 28, 17, 12, 27)
y12 <- c(20, 36, 33, 27, 28, 14, 30, 20, 27, 15, 11, 22)
y21 <- c(21, 36, 30, 27, 28, 15, 27, 18, 29, 16, 11, 22)
y22 <- c(18, 34, 29, 28, 28, 17, 27, 21, 26, 16, 14, 23)
ci.2x2.stdmean.ws(.05, y11, y12, y21, y22)
#> Estimate adj Estimate SE LL UL
#> AB: 0.17248839 0.16446123 0.13654635 -0.095137544 0.4401143
#> A: 0.10924265 0.10415878 0.05752822 -0.003510596 0.2219959
#> B: 0.07474497 0.07126653 0.05920554 -0.041295751 0.1907857
#> A at b1: 0.19548684 0.18638939 0.08460680 0.029660560 0.3613131
#> A at b2: 0.02299845 0.02192816 0.09371838 -0.160686202 0.2066831
#> B at a1: 0.16098916 0.15349715 0.09457347 -0.024371434 0.3463498
#> B at a2: -0.01149923 -0.01096408 0.08595873 -0.179975237 0.1569768
# Should return:
# Estimate adj Estimate SE LL UL
# AB: 0.17248839 0.16446123 0.13654635 -0.095137544 0.4401143
# A: 0.10924265 0.10415878 0.05752822 -0.003510596 0.2219959
# B: 0.07474497 0.07126653 0.05920554 -0.041295751 0.1907857
# A at b1: 0.19548684 0.18638939 0.08460680 0.029660560 0.3613131
# A at b2: 0.02299845 0.02192816 0.09371838 -0.160686202 0.2066831
# B at a1: 0.16098916 0.15349715 0.09457347 -0.024371434 0.3463498
# B at a2: -0.01149923 -0.01096408 0.08595873 -0.179975237 0.1569768