## 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 6 data values:

11, 93, 94, 50, 58, 64

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

## Your Answer

You got the correct answer of **61**. 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: | 11, 50, 58, 64, 93, 94 |

Step 2: |
Determine if n is even: |
n = 6 is even |

Step 3a: |
Determine n/2 and n/2+1: |
3 and 4 |

Step 3b: |
Determine data values number 3 and 4, the middle two values: |
58 and 64 |

Step 4: |
The median is the average of 58 and 64: |
61 |

Hide the R Code

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

sample = c(11, 93, 94, 50, 58, 64)

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

11

93

94

50

58

64

=MEDIAN(A2:A7)

Note that the function in Excel is `MEDIAN`

.