ci.2x2.median.ws: Computes confidence intervals of effects in a 2x2...

View source: R/statpsych1.R

ci.2x2.median.wsR Documentation

Computes confidence intervals of effects in a 2x2 within-subjects design for medians

Description

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.

Usage

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

\insertRef

Bonett2020statpsych

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)

# 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



statpsych documentation built on Sept. 11, 2024, 7:42 p.m.