An R Introduction to Statistics

Median

The median of an observation variable is the value at the middle when the data is sorted in ascending order. It is an ordinal measure of the central location of the data values.

Problem

Find the median of the eruption duration in the data set faithful.

Solution

We apply the median function to compute the median value of eruptions.

> duration = faithful$eruptions     # the eruption durations 
> median(duration)                  # apply the median function 
[1] 4

Answer

The median of the eruption duration is 4 minutes.

Exercise

Find the median of the eruption waiting periods in faithful.