Overview

This is an analysis of the ToothGrowth dataset found in the R datasets package. It looks at the effect of vitamin C on tooth growth in Guinea Pigs. The dataframe contains 60 observations on three variables: tooth length, supplement type (orange juice or ascorbic acid), and dosage in milligrams (.5, 1.0, 2.0).

Load Data

data(ToothGrowth)
head(ToothGrowth)
##    len supp dose
## 1  4.2   VC  0.5
## 2 11.5   VC  0.5
## 3  7.3   VC  0.5
## 4  5.8   VC  0.5
## 5  6.4   VC  0.5
## 6 10.0   VC  0.5

Exploratory Data Analysis

library(ggplot2)
ggplot(aes(x = supp, y = len), data = ToothGrowth) +
    geom_boxplot(aes(fill = supp)) + facet_wrap(~dose)

From the boxplot above it appears that: 1) Higher doses of either supplement result in more tooth growth. 2) At doses of 0.5 or 1.0, OJ results in more tooth growth than VC (ascorbic acid).

Confidence Intervals and Hypothesis Testing

low_dose <- ToothGrowth[ToothGrowth$dose == 0.5, ]
t.test(len ~ supp, paired=FALSE, var.equal=FALSE, data=low_dose)
## 
##  Welch Two Sample t-test
## 
## data:  len by supp
## t = 3.1697, df = 14.969, p-value = 0.006359
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  1.719057 8.780943
## sample estimates:
## mean in group OJ mean in group VC 
##            13.23             7.98

With a confidence interval of [1.72, 8.78] we can reject the null hypothesis that there is no difference between the two supplement types at the 0.5 dose level.

med_dose <- ToothGrowth[ToothGrowth$dose == 1.0, ]
t.test(len ~ supp, paired=FALSE, var.equal=FALSE, data=med_dose)
## 
##  Welch Two Sample t-test
## 
## data:  len by supp
## t = 4.0328, df = 15.358, p-value = 0.001038
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  2.802148 9.057852
## sample estimates:
## mean in group OJ mean in group VC 
##            22.70            16.77

With a confidence interval of [2.80, 9.06] we can reject the null hypothesis that there is no difference between the two supplement types at the 1.0 dose level.

high_dose <- ToothGrowth[ToothGrowth$dose == 2.0, ]
t.test(len ~ supp, paired=FALSE, var.equal=FALSE, data=high_dose)
## 
##  Welch Two Sample t-test
## 
## data:  len by supp
## t = -0.0461, df = 14.04, p-value = 0.9639
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -3.79807  3.63807
## sample estimates:
## mean in group OJ mean in group VC 
##            26.06            26.14

With a confidence interval of [-3.80, 3.64] we cannot reject the null hypothesis that there is no difference between the two supplement types at the 2.0 dose level.

Conclusions

At the dose levels of .5 and 1.0, subjects given OJ had significantly higher tooth growth than those given VC. No such difference can be stated for the 2.0 dose level.

Assumptions

This report assumes that the variances between the sample populations are not equal and that the populations are independent (not paired).