Zhe Jiang

Oct 27, 2018

Introduction

We’re going to analyze the ToothGrowth data in the R library datasets, and see how pig tooth growth differs between the dose of orange juice and Citamin C

Data Description

The response is 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).
Detail data description, click here

Data Processing

First, let’s load data and see first five cases

library(datasets)
ToothGrowth$dose <- as.factor(ToothGrowth$dose)
head(ToothGrowth)

Let’s see the summary of data

summary(ToothGrowth)
##       len        supp     dose   
##  Min.   : 4.20   OJ:30   0.5:20  
##  1st Qu.:13.07   VC:30   1  :20  
##  Median :19.25           2  :20  
##  Mean   :18.81                   
##  3rd Qu.:25.27                   
##  Max.   :33.90

Statistical Analysis

For fair stastical comparsion, let’s seperate the data based on the supp and dose. Hence, since we have two levels in supp and 3 levels in dose, the data should be splited into 6 groups.

0.5 ml dose of Orange Juice (OJ) and Vitamin C (VC) group.

OJ.5 <- ToothGrowth[which(ToothGrowth$supp == "OJ" & ToothGrowth$dose == "0.5"),]$len
VC.5 <- ToothGrowth[which(ToothGrowth$supp == "VC" & ToothGrowth$dose == "0.5"),]$len

1.0 ml dose of Orange Juice (OJ) and Vitamin C (VC) group.

OJ1<- ToothGrowth[which(ToothGrowth$supp == "OJ" & ToothGrowth$dose == "1"),]$len
VC1 <- ToothGrowth[which(ToothGrowth$supp == "VC" & ToothGrowth$dose == "1"),]$len

2.0 ml dose of Orange Juice (OJ) and Vitamin C (VC) group.

OJ2<- ToothGrowth[which(ToothGrowth$supp == "OJ" & ToothGrowth$dose == "2"),]$len
VC2 <- ToothGrowth[which(ToothGrowth$supp == "VC" & ToothGrowth$dose == "2"),]$len

First, let’s test the difference of tooth growth between same dose of Orange Juice and Vitamin C. The null hypothesis is that there is no difference between OJ and VC for same dose. In this test, we use p.value infer stastical result

t.test(VC.5, OJ.5, alternative = "less",paired = TRUE)$p.value
## [1] 0.007736024
t.test(VC1, OJ1, alternative = "less",paired = TRUE)$p.value
## [1] 0.004114624
t.test(VC2, OJ2, alternative = "less",paired = TRUE)$p.value
## [1] 0.5165216

From the 1st test between VC and OJ having 0.5 ml dose, the p-vale is 0.0077, which is smaller than 0.05. Hence, we can reject null hypothesis and conclude that dose of Orange juice 0.5 ml helps tooth growh better than dose of Vitamin C 0.5 ml. Similary, we can have same conclusiton based on the p-value for 1 ml dose is 0.004 < 0.05, and Orange Juice has better effects on tooth growth than Vitamin C when both dose of 1 ml. However, when dose is 2 ml, we cannot reject hypothesis and conclude that there is no difference in tooth growth when taking 2 ml of Orange juice or Vitamin C.

Now, let’s do trivial test for effects of same type of supp but different dose. The hypothesis that more dose promotes better tooth growth.

# compare orange juice dose of 0.5 ml and 1 ml
t.test(OJ.5, OJ1, alternative = "less",paired = TRUE)$p.value
## [1] 0.00121757
# compare orange juice dose of 0.5 ml and 2 ml
t.test(OJ.5, OJ2, alternative = "less",paired = TRUE)$p.value
## [1] 1.862051e-05
# compare orange juice dose of 1 ml and 2 ml
t.test(OJ1, OJ2, alternative = "less",paired = TRUE)$p.value
## [1] 0.04191956
# compare Vitamin C dose of 0.5 ml and 1 ml
t.test(VC.5, VC1, alternative = "less",paired = TRUE)$p.value
## [1] 8.575825e-05
# compare Vitamin C dose of 0.5 ml and 2 ml
t.test(VC.5, VC2, alternative = "less",paired = TRUE)$p.value
## [1] 2.132128e-06
# compare Vitamin C dose of 1 ml and 2 ml
t.test(VC1, VC2, alternative = "less",paired = TRUE)$p.value
## [1] 0.0002323975

Based on the all paried t-test result, all of the p-values are less than 0.05 so we can reject all null hypothesis and conclude that more dose helsp tooth growth for same type of supp.

Conclusion

From all combinations of t-test, we can conclude that more dose helps tooth growth for same type of supp. In addition, for dose of 0.5 ml and 1 ml, the mean tooth growth for orange juice group is larger than mean tooth growth of Vitamin C group. However, when dose amount sets as 2 ml, there is no significant mean difference between orange juice and Vitamin C group.