## The Problem

The median is the middle number of the sample when the values are ranked from lowest to highest. It is used to estimate the center of a population when the population is highly skewed. To illustrate calculating the median, assume that you collected the following 9 data values:

21, 16, 95, 61, 85, 33, 28, 9, 15

Calculate the median value of this sample, \( \tilde{x} \).

## Your Answer

You got the correct answer of **28**. Congratulations!

Unfortunately, your answer was not correct. Either try again or click on “Show Solution” below to see how to obtain the correct answer.

## Assistance

Hide Solution

How to calculate the median for this data
Step 1: | Sort the data from smallest to largest: | 9, 15, 16, 21, 28, 33, 61, 85, 95 |

Step 2: |
Determine if n is even: |
n = 9 is not even |

Step 3a: |
Determine (n+1)/2: |
5 |

Step 3b: |
Determine data value number 5: |
28 |

Step 4: |
The median is this middle value: |
28 |

Hide the R Code

Copy and paste the following code into your R script window, then run it from there.

sample = c(21, 16, 95, 61, 85, 33, 28, 9, 15)

median(sample)

In the R output, the median is the number output by the script.

Hide the Excel Code

Copy and paste the following code into your Excel spreadsheet window, making sure your cursor is in `A1`

when you paste.

sample

21

16

95

61

85

33

28

9

15

=MEDIAN(A2:A10)

Note that the function in Excel is `MEDIAN`

.