ToothGrowth
Data SetThe ToothGrowth
data set, which contains information on
the tooth growth of guinea pigs after receiving Vitamin C either through
a pill (Treatment = VC
) or orange juice
(Treatment = OJ
), has 60 records.
An explorable table of the data is shown next.
library(DT)
datatable(ToothGrowth)
len
The tooth growth is recorded in the variable len
. Its
mean and standard deviation are shown
below, followed by the five number summary.
Recall, the mean is simply \(\bar{x} = (\sum_i x_i)/n\) while the formula for standard deviation is shown below. \[s = \sqrt{\sum_{i=1}^n \frac{\left(x_i - \bar{x}\right)^2}{n-1}}\]
mean(ToothGrowth$len)
## [1] 18.81333
sqrt(var(ToothGrowth$len))
## [1] 7.649315
fivenum(ToothGrowth$len)
## [1] 4.20 12.55 19.25 25.35 33.90