Learn R Programming

confintr (version 0.1.0)

ci_median: Confidence Interval for the Population Median

Description

This function calculates confidence intervals for the population median by calling ci_quantile(..., q = 0.5). See ci_quantile for details.

Usage

ci_median(
  x,
  probs = c(0.025, 0.975),
  type = c("binomial", "bootstrap"),
  boot_type = c("bca", "perc", "norm", "basic"),
  R = 9999,
  seed = NULL,
  ...
)

Arguments

x

A numeric vector.

probs

Error probabilites. The default c(0.025, 0.975) gives a symmetric 95% confidence interval.

type

Type of confidence interval. One of "binomial" (default), or "bootstrap".

boot_type

Type of bootstrap confidence interval ("bca", "perc", "norm", "basic"). Only used for type = "bootstrap".

R

The number of bootstrap resamples. Only used for type = "bootstrap".

seed

An integer random seed. Only used for type = "bootstrap".

...

Further arguments passed to boot::boot.

Value

A list with class cint containing these components:

  • parameter: The parameter in question.

  • interval: The confidence interval for the parameter.

  • estimate: The estimate for the parameter.

  • probs: A vector of error probabilities.

  • type: The type of the interval.

  • info: An additional description text for the interval.

See Also

ci_quantile.

Examples

Run this code
# NOT RUN {
ci_median(1:100)
ci_quantile(1:100)
# }

Run the code above in your browser using DataLab