Author: Russ Robbins
Code Repository (right click, open new window or tab)Overview
In this data, with several caveats, it is found that increasing a 0.5mm dose to a 1mm does have a greater effect on teeth growing than a dose change from 1mm to 2mm.
In real life, a comparable finding could be that we discovered that increasing the number of ads from 500 to 1000, in a period of time, perhaps to a particular customers, has a greater effect on customers purchasing a streaming service than increasing the number of ads from 1000 to 2000.
Subjects
There were six different groups of ten guinea pigs each.
Measurements
The before and after length of teeth in millimeters.
Approaches
Question 1: Compare two delivery mechanisms. Vitamin C provided using two differing delivery mechanisms (orange juice and absorbic acid).
Question 2: Compare three different dosage levels (0.5, 1, and 2 milligrams).
Answers
Question 1: Did guinea pigs that received vitamin C via orange juice grow teeth faster than those who received vitamin C in ascorbic acid?
Answer: It is possible that guinnea pig populations that receive Vitamin C via orange juice or via ascorbic acid vary in their tooth growth rates. However, the Vitamin C delivery mechanism data in this data set do not show a statistically significant difference in the growth rates.
Question 2: Did guinea pigs that received different dosage levels (0.5, 1, 2 milligrams) grow teeth at different rates?
Answer: It is entirely possible that guinnea pig populations that are provided Vitamin C at 2 mm per dose have faster growing teeth then those given 1 mm per dose. This relationship also holds between guinea pigs with 1 mm vs. 005 mm dose amounts.
Caveats
Note that these results are tentative because of the following reason. The sample sizes, ten in any group, is very small. Larger sample sizes would have provided more information that could be relied upon to make stronger claims. While the possible error related to accepting the null hypotheses incorrectly (that there wasn’t a difference between any two groups) was considered, the possible error related to accepting the alternative hypothesis incorrectly, was not considered. It was not considered, because the standard method for addressing this risk, is increasing sample size. In this situation, the data was provided to I the analyst, and I did not have access to the experiment which occurred before 1952, which was fourteen years before I was born. Nonetheless, in an ideal world, I would have rerun the experiment with many more guinnea pigs.
Technical Discussion
This section discusses the results after testing six hypotheses. The results are summarized in the table below.
| # | Null | Alt | t-score | t-crit | p-value | alpha | conf-int | Reject Null? |
|---|---|---|---|---|---|---|---|---|
| 1 | OJ = VC | OJ not = VC | 1.92 | 2.00 | 0.06 | .05 | -0.16, 7.56 | no |
| 2 | OJ <= VC | OJ > VC | 1.92 | 1.67 | .03 | .05 | 0.4708, Inf | yes |
| 3 | 2mm = 1mm | 2mm not = 1mm | 4.90 | 2.00 | <.00001 | .05 | 3.74, 8.99 | yes |
| 4 | 2mm <= 1mm | 2mm > 1mm | 4.90 | 1.67 | <.00001 | .05 | 4.17, Inf | yes |
| 5 | 1mm = 0.5mm | 1mm not = 0.5mm | 6.48 | 2.00 | <.00001 | .05 | 6.28, 11.98 | yes |
| 6 | 1mm <= 0.5mm | 1mm > 0.5mm | 6.48 | 1.67 | <.000001 | .05 | 6.75, Inf | yes |
Hypothesis 1: Did guinea pigs that received vitamin C via orange juice grow teeth faster than those who received vitamin C in ascorbic acid?
No. When the two groups’ averages were compared, they were not statistically different, since t-score is not greater than t-critical, the p-value is greater than alpha, and mean difference of zero is within the confidence interval.
Hypothesis 2: Was the mean for the subjects receiving orange juice greater than the mean of those subjects receiving ascorbic acid?
A small effect was seen, as evidenced by the t-score that is somewhat greater than the t-critical, the p-value which is somewhat less than alpha, and the fact that a mean difference of zero was not in the confidence interval. However, the confidence interval of prospective mean differences did reach close to zero. Since the confidence interval almost included zero, we should be careful about indicating that there is an effect, expecially since Hypothesis 1 was found faulty.
Hypothesis 3: Did the groups receiving 2mm and 1mm doses have a difference in mean tooth growth?
Yes. The two groups (those receiving 2mm and those receiving 1mm doses) did not have a difference of means that could be explained only by chance. The t-score value was greater than the t-critical value, the p-value was less than the alpha value, and the estimated difference in means ranged from 3.74 mm to 8.99 mm.
Hypothesis 4: Did the groups receiving 2mm have greater mean tooth growth than subjects that received 1mm doses?
Yes. The t-score value was greater than the t-critical value, the p-value was less than the alpha value, and the estimated difference in means was greater than 4.17 mm.
Hypothesis 5: Did subjects receiving 2mm and those receiving 1mm doses have a statistically significant difference of means?
Yes. The t-score value was greater than the t-critical value, the p-value was less than the alpha value, and the estimated difference in means ranged from 6.28 mm to 11.98 mm.
Hypothesis 6: Did the groups receiving 1mm have greater mean tooth growth than subjects that received 0.5mm doses?
Yes, and the test indicated that the difference between 0.5 mm and 1 mm doses may have a larger effect than the doses ranging from 1mm to 2mm.
Code
library(knitr); data(ToothGrowth); attach(ToothGrowth);
## Warning: package 'knitr' was built under R version 3.2.1
unique(supp); unique(dose)
## [1] VC OJ
## Levels: OJ VC
## [1] 0.5 1.0 2.0
summary(ToothGrowth)
## len supp dose
## Min. : 4.20 OJ:30 Min. :0.500
## 1st Qu.:13.07 VC:30 1st Qu.:0.500
## Median :19.25 Median :1.000
## Mean :18.81 Mean :1.167
## 3rd Qu.:25.27 3rd Qu.:2.000
## Max. :33.90 Max. :2.000
VC<-subset(ToothGrowth,supp=="VC"); OJ<-subset(ToothGrowth,supp=="OJ")
Zero.5<-subset(ToothGrowth,dose==0.5); One<-subset(ToothGrowth,dose==1.0)
Two<-subset(ToothGrowth,dose==2.0)
meanVC<-mean(VC$len); meanOJ<-mean(OJ$len)
meanZero.5<-mean(Zero.5$len); meanOne<-mean(One$len); meanTwo<-mean(Two$len)
Hypothesis 1: | Null: meanOJ - meanVC = 0 | Alternative: Mean-OJ - Mean_VC != 0
ojEqVc<-t.test(x=OJ$len,y=VC$len,var.equal=TRUE,conf.level=0.95,paired=FALSE,alternative=c("two.sided"))
ojEqVc
##
## Two Sample t-test
##
## data: OJ$len and VC$len
## t = 1.9153, df = 58, p-value = 0.06039
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -0.1670064 7.5670064
## sample estimates:
## mean of x mean of y
## 20.66333 16.96333
Hypothesis 2: | Null: meanOJ - meanVC <= 0 | Alternative: meanOJ - meanVC > 0
ojGtVc<-t.test(x=OJ$len,y=VC$len,var.equal=TRUE,conf.level=0.95,paired=FALSE,alternative=c("greater"))
ojGtVc
##
## Two Sample t-test
##
## data: OJ$len and VC$len
## t = 1.9153, df = 58, p-value = 0.0302
## alternative hypothesis: true difference in means is greater than 0
## 95 percent confidence interval:
## 0.4708204 Inf
## sample estimates:
## mean of x mean of y
## 20.66333 16.96333
Hypothesis 3: | Null: mean2 - mean1 = 0 | Alternative: Mean-2 - Mean_1 != 0
twoEqOne<-t.test(x=Two$len,y=One$len,var.equal=TRUE,conf.level=0.95,paired=FALSE,alternative=c("two.sided"))
twoEqOne
##
## Two Sample t-test
##
## data: Two$len and One$len
## t = 4.9005, df = 38, p-value = 1.811e-05
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## 3.735613 8.994387
## sample estimates:
## mean of x mean of y
## 26.100 19.735
Hypothesis 4: | Null: mean2 - mean1 <= 0 | Alternative: Mean-2 - Mean_1 > 0
twoGtOne<-t.test(x=Two$len,y=One$len,var.equal=TRUE,conf.level=0.95,paired=FALSE,alternative=c("greater"))
twoGtOne
##
## Two Sample t-test
##
## data: Two$len and One$len
## t = 4.9005, df = 38, p-value = 9.054e-06
## alternative hypothesis: true difference in means is greater than 0
## 95 percent confidence interval:
## 4.175196 Inf
## sample estimates:
## mean of x mean of y
## 26.100 19.735
Hypothesis 5: | Null: mean-1 - mean-Zero.5 = 0 | Alternative: Mean-1 - Mean-Zero.5 != 0
oneEqZero.5<-t.test(x=One$len,y=Zero.5$len,var.equal=TRUE,conf.level=0.95,paired=FALSE,alternative=c("two.sided"))
oneEqZero.5
##
## Two Sample t-test
##
## data: One$len and Zero.5$len
## t = 6.4766, df = 38, p-value = 1.266e-07
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## 6.276252 11.983748
## sample estimates:
## mean of x mean of y
## 19.735 10.605
Hypothesis 6: | Null: mean-1 - mean-Zero.5 <= 0 | Alternative: Mean-1 - Mean-Zero.5 > 0
oneGtZero.5<-t.test(x=One$len,y=Zero.5$len,var.equal=TRUE,conf.level=0.95,paired=FALSE,alternative=c("greater"))
oneGtZero.5
##
## Two Sample t-test
##
## data: One$len and Zero.5$len
## t = 6.4766, df = 38, p-value = 6.331e-08
## alternative hypothesis: true difference in means is greater than 0
## 95 percent confidence interval:
## 6.753344 Inf
## sample estimates:
## mean of x mean of y
## 19.735 10.605