In this report, we utilize the ToothGrowth dataset to explore the effect of dosage and delivery method of vitamin C on tooth length in guinea pigs. Using T tests and assuming non-equal variance between groups, we show that while there is not a significant difference between methods of vitamin C administration, there is a positive relationship between the dose of vitamin C and the length of teeth in guinea pigs.
First, the datasets package is required and the ToothGrowth data is loaded. The structure of the data is observed.
require(datasets)
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 ...
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
The data frame has 60 observations of three variables:
len is a numeric variable representing tooth length
supp is a factor variable indicating the supplement type
dose is a numeric variable quantifying the dosage given in milligrams.
unique(ToothGrowth$supp)
## [1] VC OJ
## Levels: OJ VC
unique(ToothGrowth$dose)
## [1] 0.5 1.0 2.0
table(ToothGrowth$supp,ToothGrowth$dose)
##
## 0.5 1 2
## OJ 10 10 10
## VC 10 10 10
There were two methods for administering vitamin C to the guinea pigs (orange juice and ascorbic acid) and three dosages they were given (0.5, 1, or 2 mg). The dosages and methods were spread out evenly among the 60 guinea pigs.
summary(ToothGrowth$len)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 4.20 13.08 19.25 18.81 25.28 33.90
Before we establish a null hypothesis, some exploratory data analysis is carried out. We investigate boxplots of the length of teeth broken down by delivery method and dose in order to establish whether there appears to be a trend.
boxplot(len ~ supp * dose, data=ToothGrowth,
col=rainbow(6, start = .18, end = .5),
main="Boxplots of Tooth Growth for Groups of 10 Guinea Pigs",
xlab="Delivery Method and Dose", ylab="Tooth Length"
)
From the boxplots, we can see that orange juice (coded as OJ) seems to result in greater tooth length than ascorbic acid (coded as VC), and that higher doses of vitamin C seem to yield greater tooth growth than lower doses.
We will investigate two claims:
Orange juice yieds teeth of greater length than ascorbic acid.
Higher doses of vitamin C result in greater tooth length.
The null hypothesis states that there is no difference on the length of teeth between administering orange juice or ascorbic acid to guinea pigs. The alternative hypothesis, thus, is that there is a difference. We analyze the quartiles of the length data separated by method.
with(ToothGrowth,tapply(len,INDEX=supp,FUN=summary))
## $OJ
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 8.20 15.52 22.70 20.66 25.72 30.90
##
## $VC
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 4.20 11.20 16.50 16.96 23.10 33.90
Both the median and mean for orange juice are higher than for ascorbic acid. To determine whether these results are significant, we carry out a T test, indicating in the code that the values are not paired (meaning that the OJ guinea pigs are different from the VC pigs) and that the variances are not to be treated as equal, that is, we do not use a pooled variance.
with(ToothGrowth,t.test(len[supp=="OJ"],len[supp=="VC"],paired=FALSE,var.equal=FALSE))
##
## Welch Two Sample t-test
##
## data: len[supp == "OJ"] and len[supp == "VC"]
## t = 1.9153, df = 55.309, p-value = 0.06063
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -0.1710156 7.5710156
## sample estimates:
## mean of x mean of y
## 20.66333 16.96333
Our specific value of interest is the p-value which is:
with(ToothGrowth,t.test(len[supp=="OJ"],len[supp=="VC"],paired=FALSE,var.equal=FALSE))$p.val
## [1] 0.06063451
Since the p-value is 0.061, this implies that there is insufficient evidence to reject the null hypothesis with 95% confidence. Therefore, it cannot be concluded that there is a difference between administerng vitamin C as orange juice or as ascorbic acid.
For doses of vitamin C, the null hypothesis states that there is no difference observed in tooth lengths as a result of differences in vitamin C doses (0.5, 1, or 2 mg). The alternative hypothesis is that there is a difference in length. First, we explore the quartiles for length separated by dose.
with(ToothGrowth, tapply(len, INDEX=dose, FUN=summary))
## $`0.5`
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 4.200 7.225 9.850 10.600 12.250 21.500
##
## $`1`
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 13.60 16.25 19.25 19.74 23.38 27.30
##
## $`2`
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 18.50 23.52 25.95 26.10 27.83 33.90
The values indicate an increase in both the mean and median lengths as dosage increases. We first carry out a T test to compare 0.5 mg to 1 mg, again indicating in the code that the values are not paired and that the variances are not to be treated as equal.
with(ToothGrowth, t.test(len[dose==0.5],len[dose==1],paired=FALSE,var.equal=FALSE))
##
## Welch Two Sample t-test
##
## data: len[dose == 0.5] and len[dose == 1]
## t = -6.4766, df = 37.986, p-value = 1.268e-07
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -11.983781 -6.276219
## sample estimates:
## mean of x mean of y
## 10.605 19.735
Given that the p-value is:
with(ToothGrowth, t.test(len[dose==0.5],len[dose==1],paired=FALSE,var.equal=FALSE))$p.val
## [1] 1.268301e-07
we reject the null hypothesis, which again stated that there is no difference in effect on tooth length between administering a dose of 0.5 mg and a dose of 1 mg.
Next, we consider 1 mg against 2 mg.
with(ToothGrowth, t.test(len[dose==1],len[dose==2],paired=FALSE,var.equal=FALSE))
##
## Welch Two Sample t-test
##
## data: len[dose == 1] and len[dose == 2]
## t = -4.9005, df = 37.101, p-value = 1.906e-05
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -8.996481 -3.733519
## sample estimates:
## mean of x mean of y
## 19.735 26.100
The T test yields a p-value of:
with(ToothGrowth, t.test(len[dose==1],len[dose==2],paired=FALSE,var.equal=FALSE))$p.val
## [1] 1.90643e-05
Just as in the previous case, the p-value is quite low and we therefore reject the null hypothesis. For more evidence that there is a relationship between dosage of vitamin C and length of teeth, we carry out an additional T test, this time comparing a dose of 0.5 mg to 2 mg.
with(ToothGrowth, t.test(len[dose==0.5],len[dose==2],paired=FALSE,var.equal=FALSE))
##
## Welch Two Sample t-test
##
## data: len[dose == 0.5] and len[dose == 2]
## t = -11.799, df = 36.883, p-value = 4.398e-14
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -18.15617 -12.83383
## sample estimates:
## mean of x mean of y
## 10.605 26.100
For this test, the p-value is:
with(ToothGrowth, t.test(len[dose==0.5],len[dose==2],paired=FALSE,var.equal=FALSE))$p.val
## [1] 4.397525e-14
which again provides sufficient evidence to reject the null hypothesis. From these three tests, we conclude that there appears to be a positive relationship between the dose of vitamin C to the length of teeth.
The conclusions we have drawn as a result of the hypothesis tests rely on several assumptions about the data and how it was collected. First, we assumed that the groups of guinea pigs were entirely independent. Each of the 60 guinea pigs was administered a particular dose via one of two methods, and we have assumed that the dose and method were not affected by other methods. Additionally, the sample of guinea pigs was assumed to be entirely random and the six groups were assumed to be comprised of similar guinea pigs (e.g. age, breed, etc.). Finally, as stated within the hypothesis testing section of this report, it was assumed that the variances between groups were unequal.
We set out to determine whether the method of administration of vitamin C (orange juice or ascorbic acid) and/or the dose of vitamin C (0.5, 1, or 2 mg) had a significant effect on the length of teeth in a group of guinea pigs. Using T tests, there was not evidence to conclude that either orange juice or ascorbic acid had a greater impact than the other. However, the T tests did show that the greater the dose of vitamin C, regardless of administration method, the greater the length of odotoblasts. From this research, it cannot be concluded whether increasing the dosage beyond 2 mg would have yet a greater impact on teeth. However, according to Yew (1973), guinea pigs need a minimum of 5 mg / 100 g of bodyweight / day. Further research is required to determine whether there is an upper bound for vitamin C dosage on both tooth length and on guinea pigs’ overall health and safety.
“R: The Effect of Vitamin C on Tooth Growth in Guinea Pigs.” R: The Effect of Vitamin C on Tooth Growth in Guinea Pigs. ETH Zurich, n.d. Web. 11 Mar. 2016.
Yew, Man-Li S. “”Recommended Daily Allowances" for Vitamin C." Proceedings of the National Academy of Sciences of the United States of America 70.4 (1973): 969-72. JSTOR. Web. 11 Mar. 2016.