Find a Confidence Interval for a Median (Step by Step)

To find a confidence interval for a median, first calculate the median of the data set. Next, calculate the standard error of the median by taking the square root of the ratio of the sample size to the number of data points in the set minus one. Then, use the standard error to calculate the lower and upper bounds of the confidence interval by subtracting and adding the standard error to the median value respectively. Finally, the confidence interval for the median is the range of values between the lower and upper bounds.


We can use the following formula to calculate the upper and lower bounds of a 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 .

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
  • 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].

x