The variance is a numerical measure of how the data values is dispersed around the mean. In particular, the sample variance is defined as:
Similarly, the population variance is defined in terms of the population mean μ and population size N:
Find the variance of the eruption duration in the data set faithful.
We apply the var function to compute the variance of eruptions.
> var(duration) # apply the var function
The variance of the eruption duration is 1.3027.
Find the variance of the eruption waiting periods in faithful.