Computes distribution-free confidence intervals for the AB interaction effect, 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. The effects are defined in terms of medians rather than means. Tied scores are assumed to be rare.

ci.2x2.median.ws(alpha, y11, y12, y21, y22)

Arguments

alpha

alpha level for 1-alpha confidence

y11

vector of scores at level 1 of A and level 1 of B

y12

vector of scores at level 1 of A and level 2 of B

y21

vector of scores at level 2 of A and level 1 of B

y22

vector of scores at level 2 of A and level 2 of B

Value

Returns a 7-row matrix (one row per effect). The columns are:

  • Estimate - estimate of effect

  • SE - standard error

  • LL - lower limit of the confidence interval

  • UL - upper limit of the confidence interval

References

Bonett DG, Price RM (2020). “Interval estimation for linear functions of medians in within-subjects and mixed designs.” British Journal of Mathematical and Statistical Psychology, 73(2), 333--346. ISSN 0007-1102, doi:10.1111/bmsp.12171 .

Examples

y11 <- c(221, 402, 333, 301, 284, 182, 281, 230, 290, 182, 133, 278)
y12 <- c(221, 371, 340, 288, 293, 150, 317, 211, 286, 161, 126, 234)
y21 <- c(219, 371, 314, 279, 284, 155, 278, 185, 296, 169, 118, 229)
y22 <- c(170, 332, 280, 273, 272, 160, 260, 204, 252, 153, 137, 221)
ci.2x2.median.ws(.05, y11, y12, y21, y22)
#>          Estimate        SE         LL       UL
#> AB:          2.50 21.050122 -38.757482 43.75748
#> A:          24.75  9.603490   5.927505 43.57250
#> B:          18.25  9.101881   0.410641 36.08936
#> A at b1:    26.00 11.813742   2.845491 49.15451
#> A at b2:    23.50 16.323093  -8.492675 55.49267
#> B at a1:    19.50 15.710347 -11.291715 50.29171
#> B at a2:    17.00 11.850202  -6.225970 40.22597

# Should return:
#          Estimate       SE         LL        UL
# AB:          2.50 21.050122 -38.757482 43.75748
# A:          24.75  9.603490   5.927505 43.57250
# B:          18.25  9.101881   0.410641 36.08936
# A at b1:    26.00 11.813742   2.845491 49.15451
# A at b2:    23.50 16.323093  -8.492675 55.49267
# B at a1:    19.50 15.710347 -11.291715 50.29171
# B at a2:    17.00 11.850202  -6.225970 40.22597