This project will analyze the tooth data available on R, “The Effect of Vitamin C on Tooth Growth in Guinea Pigs”. This dataset provides data on the length of odontoblasts (cells responsible for tooth growth) in 60 guinea pigs. Each animal received one of three dose levels of vitamin C (0.5, 1, and 2 mg/day) by one of two delivery methods, orange juice or ascorbic acid (a form of vitamin C and coded as VC).
This dataset contains 60 observations for 3 variables:
1. len: numeric tooth length
2. supp: supplment type - oj = orange juice, vc = ascorbhic acid
3. dose: dose in milligrams/day - 0.5mg, 1mg, and 2mg
| dose | count | mean | sd |
|---|---|---|---|
| 0.5 | 20 | 10.605 | 4.499763 |
| 1.0 | 20 | 19.735 | 4.415436 |
| 2.0 | 20 | 26.100 | 3.774150 |
| supp | count | mean | sd |
|---|---|---|---|
| OJ | 30 | 20.66333 | 6.605561 |
| VC | 30 | 16.96333 | 8.266029 |
ggboxplot(ToothGrowth, x ="dose", y ="len",
color = "dose", palette = c("#00AFBB", "#E7B800", "#FC4E07"),
order = c("0.5", "1", "2"),
ylab = "Length", xlab = "Dose")
ggboxplot(ToothGrowth, x = "supp", y = "len",
color = "supp", palette = c("#00AFBB", "#FC4E07"),
order = c("VC", "OJ"),
ylab = "Tooth Growth", xlab = "Supplement")
This analysis will use two hypothesis tests. A t-test will be used to compare the tooth growth length between the two types of Vitamin C supplements (orange juice vs ascorbic acid). The t-test assumes independent observations that follow a normal distrbution. The second hypothesis test is a one-way analysis of variance (ANOVA) to compare tooth growth by dose group (0.5mg, 1mg, and 2mg). This anlaysis assumes observations are obtained independently and randomly from a population defined by factor levels (factors = doses). The ANOVA assumes the data is noramlly distrbuted at each level, and there is a common variance for the population.
t.test(len ~ supp, paired = FALSE, var.equal = TRUE, data = ToothGrowth)
##
## Two Sample t-test
##
## data: len by supp
## 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 in group OJ mean in group VC
## 20.66333 16.96333
res.aov <- aov(len ~ dose, data = ToothGrowth)
summary(res.aov)
## Df Sum Sq Mean Sq F value Pr(>F)
## dose 1 2224 2224.3 105.1 1.23e-14 ***
## Residuals 58 1228 21.2
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
The t-test indicated that there was not a statistically significant difference between the types of vitamin C supplements (p-0.06). The mean toothe growth length for the orange juice group was 20.6 compared to the ascorbic acid group, which had a mean tooth growth length of 16.9.
The one-way ANOVA indicated that there was a significant differenct between the dose groups (p<0.001). This hypothesis test indicates that there are significant differences between the average toothe growth lengths for the dose of Vitamin C.