The response is the length of odontoblasts (teeth) in each of 10 guinea pigs at each of three dose levels of Vitamin C (0.5, 1, and 2 mg) with each of two delivery methods (orange juice or ascorbic acid).
The data consists of a data frame with 60 observations on 3 variables.
| Index | colname | class | description |
|---|---|---|---|
| [,1] | len | numeric | Tooth length |
| [,2] | supp | factor | Supplement type (VC or OJ). |
| [,3] | dose | numeric | Dose in milligrams. |
A box plot of the resulting tooth growth for different dosages and delivery methods of vitamin C:
A summary of the means and standard deviation and error for the samples of the different treatments.
ddply(.data = ToothGrowth, .variables = .(supp,dose), summarize,
mean = mean(len), std.dev = sd(len), n=length(len),
std.error = sd(len)/sqrt(length(len)))
## supp dose mean std.dev n std.error
## 1 OJ 0.5 13.23 4.460 10 1.4103
## 2 OJ 1.0 22.70 3.911 10 1.2368
## 3 OJ 2.0 26.06 2.655 10 0.8396
## 4 VC 0.5 7.98 2.747 10 0.8686
## 5 VC 1.0 16.77 2.515 10 0.7954
## 6 VC 2.0 26.14 4.798 10 1.5172
From the summary data and the box plot, it would appear that for a given dose (0.5mg, 1.0mg, 2.0mg) the OJ delivery method results in greater tooth growth.
Our null hypothesis is that the mean tooth growth for the orange juice (OJ) group is equal to the mean tooth growth of the ascorbic acid group (VC), for the same dosage of vitamin C. The alternative hypothesis is that they are not equal.
\[H_{0}:\mu_{vc}=\mu_{oj} \Leftrightarrow \mu_{vc}-\mu_{oj} = 0\] \[H_{a}:\mu_{vc}\neq\mu_{oj}\]
Our test statistic will be that for two group intervals:
\[TS=\frac{\overline{X_{1}}-\overline{X_{2}}}{\sqrt{\frac{S_{1}^2}{n_{1}}+\frac{S_{2}^2}{n_{2}}}}\]
We will assume \(\alpha=0.05\), or a 95% confidence interval. We will use the Student t distribution due to the small sample size (n=10 for each treatment modality).
The rejection region can be obtained using qt() for our desired confidence interval:
c(qt(0.025,9),qt(0.975,9))
## [1] -2.262 2.262
We can reject \(H_{0}\) if the test statistic falls outside this interval.
We can use the mean and standard deviations for each treatment modality computed earlier to determine the test statistic for comparing OJ and VC for a 0.5mg vitamin C dose.
(13.23-7.98)/sqrt((4.460^2/10)+(2.747^2)/10)
## [1] 3.169
This test statistic falls outside the range [-2.262,2.262] so we can reject the null hypothesis for this dose.
We could, alternately, have used t.test:
t.test(ToothGrowth[ToothGrowth$supp == "OJ" & ToothGrowth$dose == 0.5,]$len,
ToothGrowth[ToothGrowth$supp == "VC" & ToothGrowth$dose == 0.5,]$len)$statistic
## t
## 3.17
This matches our computation.
Performing the same test statistic computation for 1.0mg:
(22.70-16.77)/sqrt((3.911^2/10)+(2.515^2)/10)
## [1] 4.033
t.test(ToothGrowth[ToothGrowth$supp == "OJ" & ToothGrowth$dose == 1.0,]$len,
ToothGrowth[ToothGrowth$supp == "VC" & ToothGrowth$dose == 1.0,]$len)$statistic
## t
## 4.033
Our manual computation agrees with the t.test computation. We can again reject the null hypothesis for 1.0mg.
Finally, for 2.0mg we perform the same computation of the test statistic.
(26.06-26.14)/sqrt((2.655^2/10)+(4.798^2)/10)
## [1] -0.04613
t.test(ToothGrowth[ToothGrowth$supp == "OJ" & ToothGrowth$dose == 2.0,]$len,
ToothGrowth[ToothGrowth$supp == "VC" & ToothGrowth$dose == 2.0,]$len)$statistic
## t
## -0.04614
This time the test statistic falls within the interval [-2.262,2.262] and we cannot reject the null hypothesis for 2.0mg.
From the data and analysis we conclude that we reject the null hypothesis \(H_{0}:\mu_{VC}=\mu_{OJ}\) and adopt the alternative hypothesis \(H_{a}:\mu_{VC}\neq\mu_{OJ}\) but only for dosages 0.5mg and 1.0mg. For 2.0mg, the data does not support rejecting the null hypothesis.
We therefore conclude that delivery of vitamin C via orange juice results in greater tooth growth compared to ascorbic acid at 0.5mg and 1.0mg dosages. At a 2.0mg dose, both ascorbic acid and orange juice result in similar levels of tooth growth.