60 guinea pigs received vitamin C either as contained in orange juice or pure (probably dissolved in water) with different levels of dosage. Odontoblasts are cells that promote tooth growth. The length of these cells was taken as a measure of tooth growth in response to the supplements. This report addresses the question which supplement is more effective as stimulans for tooth growth.
After loading the data, a few summary statistics are shown. There are 60 observations on three variables.
data(ToothGrowth)
str(ToothGrowth)
## 'data.frame': 60 obs. of 3 variables:
## $ len : num 4.2 11.5 7.3 5.8 6.4 10 11.2 11.2 5.2 7 ...
## $ supp: Factor w/ 2 levels "OJ","VC": 2 2 2 2 2 2 2 2 2 2 ...
## $ dose: num 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 ...
summary(ToothGrowth$len)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 4.20 13.08 19.25 18.81 25.28 33.90
table(ToothGrowth$dose, ToothGrowth$supp)
##
## OJ VC
## 0.5 10 10
## 1 10 10
## 2 10 10
There are only two values for the supplement factor variable, OJ (orange juice) and VC (pure vitamin C), while dosage occurs at three different levels. Each combination of supplement and dosage was tried on 10 guinea pigs. The description of the dataset does not provide any unit for the length variable. Therefore we treat it as given in arbitrary units.
The length variable is plotted as a function of the dosage, separately for the two types of supplements.
par(mfrow=c(1, 2))
boxplot(len ~ dose, subset=(supp=="OJ"),
data=ToothGrowth,
ylim=c(range(ToothGrowth$len)),
main="Orange juice",
xlab="Dosage in mg/day",
ylab="Tooth length in arbitrary units")
boxplot(len ~ dose, subset=(supp=="VC"),
data=ToothGrowth,
ylim=c(range(ToothGrowth$len)),
main="Vitamin C",
xlab="Dosage in mg/day",
ylab="Tooth length in arbitrary units")
This section addresses the question whether the orange juice supplement leads to significantly lower or higher tooth growth than the pure vitamin C supplement.
The data is split by supplement and compared for each level of dosage. The null hypothesis is that the means of the tooth length data are equal. Thus the alternative hypothesis is that the means differ.
Since each individual animal is only present in one of the groups, the t-test is not paired. The default confidence level of 95% is used. A two-sided t-test is performed because it is a priori not known which supplement leads to more tooth growth.
oj <- subset(ToothGrowth, ToothGrowth$supp == "OJ")
vc <- subset(ToothGrowth, ToothGrowth$supp == "VC")
ttest.low <- t.test(oj$len[oj$dose == 0.5] - vc$len[vc$dose == 0.5], paired=FALSE)
ttest.medium <- t.test(oj$len[oj$dose == 1] - vc$len[vc$dose == 1], paired=FALSE)
ttest.high <- t.test(oj$len[oj$dose == 2] - vc$len[vc$dose == 2], paired=FALSE)
For both low dosage (0.5 mg/day) and medium dosage (1 mg/day) orange juice is on average significantly more effective than pure vitamin C. The confidence intervals for the difference in means are [1.263, 9.237] and [1.952, 9.908], respectively. Both confidence intervals do not include zero. Therefore the null hypothesis is rejected in both cases with p-values of 0.015 and 0.008, respectively.
On the other hand, for high dosage (2 mg/day) the effect of orange juice and pure vitamin C is on average the same. The means differ by only -0.08. The confidence interval for the difference in means is [-4.329, 4.169], which is nearly centered on zero. Therefore the null hypothesis is rejected with a p-value of 0.967.
Please refer to the appendix for the full set of results from the t-tests.
In this section the effect of each supplement for different levels of dosage is investigated. The null hypothesis is that the mean tooth length is the same for two types of dosage. Here we focus on comparing low (0.5 mg/day) and medium (1 mg/day) dosage as well as medium and high (2 mg/day) dosage. The alternative hypothesis is that the means are different. The t-tests are performed analogously to the previous section.
ttest.oj.low.medium <- t.test(oj$len[oj$dose == 1] - oj$len[oj$dose == 0.5], paired=FALSE)
ttest.oj.medium.high <- t.test(oj$len[oj$dose == 2] - oj$len[oj$dose == 1], paired=FALSE)
ttest.vc.low.medium <- t.test(vc$len[vc$dose == 1] - vc$len[vc$dose == 0.5], paired=FALSE)
ttest.vc.medium.high <- t.test(vc$len[vc$dose == 2] - vc$len[vc$dose == 1], paired=FALSE)
It turns out that all groups are significantly different except for orange juice for medium and high dosages (at the 95% confidence level, with a p-value of 0.084).
Please refer to the appendix for the full set of results from the t-tests.
Orange juice as a supplement was found to be significantly more effective in stimulating tooth growth in guinea pigs than pure vitamin C for low and medium dosages. However, the sample variance of the effect is larger for orange juice. For high dosages, the two supplements perform very similarly, although the sample variance of the effect is now larger for pure vitamin C.
Dosage is positively correlated with tooth length:
cor(oj$dose, oj$len)
## [1] 0.7500585
cor(vc$dose, vc$len)
## [1] 0.8989722
A more detailed analysis of the relationship between dosage and tooth length could be performed with regression models.
T-test for orange juice versus pure vitamin C supplement for low dosage
ttest.low
##
## One Sample t-test
##
## data: oj$len[oj$dose == 0.5] - vc$len[vc$dose == 0.5]
## t = 2.9791, df = 9, p-value = 0.01547
## alternative hypothesis: true mean is not equal to 0
## 95 percent confidence interval:
## 1.263458 9.236542
## sample estimates:
## mean of x
## 5.25
T-test for orange juice versus pure vitamin C supplement for medium dosage
ttest.medium
##
## One Sample t-test
##
## data: oj$len[oj$dose == 1] - vc$len[vc$dose == 1]
## t = 3.3721, df = 9, p-value = 0.008229
## alternative hypothesis: true mean is not equal to 0
## 95 percent confidence interval:
## 1.951911 9.908089
## sample estimates:
## mean of x
## 5.93
T-test for orange juice versus pure vitamin C supplement for high dosage
ttest.high
##
## One Sample t-test
##
## data: oj$len[oj$dose == 2] - vc$len[vc$dose == 2]
## t = -0.042592, df = 9, p-value = 0.967
## alternative hypothesis: true mean is not equal to 0
## 95 percent confidence interval:
## -4.328976 4.168976
## sample estimates:
## mean of x
## -0.08
T-test for low versus medium dosage for orange juice supplement
ttest.oj.low.medium
##
## One Sample t-test
##
## data: oj$len[oj$dose == 1] - oj$len[oj$dose == 0.5]
## t = 4.1635, df = 9, p-value = 0.002435
## alternative hypothesis: true mean is not equal to 0
## 95 percent confidence interval:
## 4.324616 14.615384
## sample estimates:
## mean of x
## 9.47
T-test for medium versus high dosage for orange juice supplement
ttest.oj.medium.high
##
## One Sample t-test
##
## data: oj$len[oj$dose == 2] - oj$len[oj$dose == 1]
## t = 1.9435, df = 9, p-value = 0.08384
## alternative hypothesis: true mean is not equal to 0
## 95 percent confidence interval:
## -0.5509376 7.2709376
## sample estimates:
## mean of x
## 3.36
T-test for low versus medium dosage for pure vitamin C supplement
ttest.vc.low.medium
##
## One Sample t-test
##
## data: vc$len[vc$dose == 1] - vc$len[vc$dose == 0.5]
## t = 6.1364, df = 9, p-value = 0.0001715
## alternative hypothesis: true mean is not equal to 0
## 95 percent confidence interval:
## 5.549601 12.030399
## sample estimates:
## mean of x
## 8.79
T-test for medium versus high dosage for pure vitamin C supplement
ttest.vc.medium.high
##
## One Sample t-test
##
## data: vc$len[vc$dose == 2] - vc$len[vc$dose == 1]
## t = 5.346, df = 9, p-value = 0.0004648
## alternative hypothesis: true mean is not equal to 0
## 95 percent confidence interval:
## 5.405082 13.334918
## sample estimates:
## mean of x
## 9.37