Before going in depth into the topic of this section, let me remind the reader of three mathematical notions that will be used in this chapter: arithmetic mean, variance, and standard deviation. Some have been already discussed in other chapters, but a more formal definition is interesting for the purposes of the chapter.
The arithmetic mean is a measure of central tendency. Considering a sample of observations of an attribute—for instance, the height of individuals—the arithmetic mean is simply the sum of the values of the observations divided by the number of observations. We are interested in computing the mean height of three individuals measuring 160 cm, 170 cm, and 180 cm.
The formula for the mean is:
Type the following in the R console to compute the arithmetic mean of this sample:
(160 + 170 + 180) / 3
R outputs the following:
[1] 170
Check the solution by typing this:
mean(c(160,170,180))
Our computation of the mean was correct—R outputs:
[1] 170
Variance is a...