Learn R Programming

statpsych (version 2.0.0)

ci.median: Confidence interval for a median

Description

Computes a distribution-free confidence interval for a population median. Tied scores are assumed to be rare.

For more details, see Section 1.25 of Bonett (2021, Volume 1)

Usage

ci.median(alpha, y)

Value

Returns a 1-row matrix. The columns are:

  • Estimate - estimated median

  • SE - standard error

  • LL - lower limit of the confidence interval

  • UL - upper limit of the confidence interval

Arguments

alpha

alpha level for 1-alpha confidence

y

vector of scores

References

Snedecor1980statpsych

Bonett2021statpsych

Examples

Run this code
y <- c(25, 29, 35, 36, 36, 40, 41, 43, 44, 54)
ci.median(.05, y)

# Should return:
#  Estimate       SE  LL  UL
#        38 3.261774  29  44


Run the code above in your browser using DataLab