An R Introduction to Statistics

Mean

The mean of an observation variable is a numerical measure of the central location of the data values. It is the sum of its data values divided by data count.

Hence, for a data sample of size n, its sample mean is defined as follows:

    1-∑n
x¯= n    xi
      i=1

Similarly, for a data population of size N, the population mean is:

    1 ∑N
μ = --   xi
    N i=1

Problem

Find the mean eruption duration in the data set faithful.

Solution

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

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

Answer

The mean eruption duration is 3.4878 minutes.

Exercise

Find the mean eruption waiting periods in faithful.