Computes a distribution-free confidence interval for a ratio of population medians in a paired-samples design. Ratio-scale measurements are assumed.
ci.ratio.median.ps(alpha, y1, y2)
alpha level for 1-alpha confidence
vector of scores for measurement 1
vector of scores for measurement 2 (paired with y1)
Returns a 1-row matrix. The columns are:
Median1 - estimated median for measurement 1
Median2 - estimated median for measurement 2
Median1/Median2 - estimated ratio of medians
LL - lower limit of the confidence interval
UL - upper limit of the confidence interval
Bonett DG, Price RM (2020). “Confidence intervals for ratios of means and medians.” Journal of Educational and Behavioral Statistics, 45(6), 750--770. doi:10.3102/1076998620934125 .
y1 <- c(21, 4, 9, 12, 35, 18, 10, 22, 24, 1, 6, 8, 13, 16, 19)
y2 <- c(67, 28, 30, 28, 52, 40, 25, 37, 44, 10, 14, 20, 28, 40, 51)
ci.ratio.median.ps(.05, y1, y2)
#> Median1 Median2 Median1/Median2 LL UL
#> 13 30 0.4333333 0.3094838 0.6067451
# Should return:
# Median1 Median2 Median1/Median2 LL UL
# 13 30 0.4333333 0.3094838 0.6067451