Home Â» How to Find a Confidence Interval for a Median (Step-by-Step)

# How to Find a Confidence Interval for a Median (Step-by-Step)

We can use the following formula to calculate the upper and lower bounds of a confidence interval for a population median:

j: nqÂ  â€“Â  zâˆšnq(1-q)

k: nqÂ  +Â  zâˆšnq(1-q)

where:

• n: The sample size
• q: The quantile of interest. For a median, we will use q = 0.5.
• z: The z-critical value

We round j and k up to the next integer. The resulting confidence interval is between the jth and kth observations in the ordered sample data.

Note that the z-value that you will use is dependent on the confidence level that you choose. The following table shows the z-value that corresponds to popular confidence level choices:

Confidence Level z-value
0.90 1.645
0.95 1.96
0.99 2.58

Source: This formula comes fromÂ Practical Nonparametric Statistics, 3rd Edition by W.J. Conover.

The following step-by-step example shows how to calculate a confidence interval for a population median using the following sample data of 15 values:

Sample data:Â 8, 11, 12, 13, 15, 17, 19, 20, 21, 21, 22, 23, 25, 26, 28

### Step 1: Find the Median

First, we need to find the median of the sample data. This turns out to be the middle value ofÂ 20:

8, 11, 12, 13, 15, 17, 19, 20, 21, 21, 22, 23, 25, 26, 28

### Step 2: FindÂ j andÂ k

Suppose we would like to find a 95% confidence interval for the population median. To do so, we need to first find j and k:

• j: nq â€“ zâˆšnq(1-q) = (15)(.5) â€“ 1.96âˆš(15)(.5)(1-.5) = 3.7
• k: nq + zâˆšnq(1-q) = (15)(.5) + 1.96âˆš(15)(.5)(1-.5) = 11.3

We will round bothÂ j andÂ k up to the nearest integer:

• j: 4
• k: 12

### Step 3: Find the Confidence Interval

The 95% confidence interval for the median will be between the j = 4th and k = 12th observation in the sample dataset.

The 4th observation is equal to 13 and the 12th observation is equal to 23:

8, 11, 12, 13, 15, 17, 19, 20, 21, 21, 22, 23, 25, 26, 28

Thus, the 95% confidence interval for the median turns out to be [13, 23].
{"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "https://www.tutoraspire.com/confidence-interval-for-median/", "fetch_time": 1721568372000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2024-30/segments/1720763517701.96/warc/CC-MAIN-20240721121510-20240721151510-00005.warc.gz", "warc_record_offset": 884918830, "warc_record_length": 60964, "token_count": 707, "char_count": 2064, "score": 4.59375, "int_score": 5, "crawl": "CC-MAIN-2024-30", "snapshot_type": "latest", "language": "en", "language_score": 0.8338066339492798, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00010-of-00064.parquet"}