Given a sample *X_1, ..., X_n*, this function computes an exact confidence interval for the median of the sample
based on the binomial distribution.

1 | ```
confIntMedian(x, conf.level = 0.95)
``` |

`x` |
Vector of observations. |

`conf.level` |
Confidence level for confidence interval. |

Table containing the median and the confidence interval.

Kaspar Rufibach

kaspar.rufibach@gmail.com

Lehmann, E. (1975).
Nonparametrics: Statistical Methods Based on Ranks.
*Holden-Day*, 182–183.

A worked out example (in Section 5, p. 38) can be found in

Altman, D.G., Machin, D., Bryant, T.N., Gardner, M.J.(2000). Statistics with confidence. University Press Belfast.

1 2 3 4 5 6 7 8 9 10 11 | ```
# generate random sample
set.seed(1977)
n <- 40
x <- rnorm(n)
# compute CI for median
confIntMedian(x, conf.level = 0.95)
# data from Altman (2000), p. 38
x <- c(66, 71.2, 83, 83.6, 101, 107.6, 122, 143, 160, 177, 414)
confIntMedian(x, conf.level = 0.95)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.