Course Project 2

1. Title

Significant differences in the length of odontoblasts in Guinea pigs as the dose or methods of vitamin C

(By Jihan Yu)

2. Overview

THe length of odontoblasts in Guinea pigs can be influenzed by the Vitamin C. They were significant differences with the delivery methods of viatmine C(orange juice(OJ) or ascorbic acid(VC)). - The ascorbic acid was better than orange juice. And the lengths became taller as the dose of vitamin C.

3. Simulations & Results

Load data & some basic exploratory data analyses

  • declare required library
  • define the function which calculates basic summary with barplot according to supp & dose
#####  Load the ToothGrowth data & some basic exploratory data analyses #####
workingpath <- "C:\\Users\\MED1\\Stat_Inf"
setwd(workingpath)
library(ggplot2);  library(gridExtra)

ToothGrowth$dose <- as.factor(ToothGrowth$dose)
attach(ToothGrowth)
summary(ToothGrowth$len)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    4.20   13.07   19.25   18.81   25.27   33.90
table(ToothGrowth$supp)
## 
## OJ VC 
## 30 30
table(ToothGrowth$dose)
## 
## 0.5   1   2 
##  20  20  20
##### basic summary of the data #####
basic.sum <- function(test.vec){
    res <- c(mean(test.vec), sd(test.vec), median(test.vec), min(test.vec), max(test.vec))
    names(res) <- c("mean", "Std.Dev.", "median", "min", "max")
    return ( res )  
}

total <- basic.sum(ToothGrowth$len)
supp.OJ <- basic.sum(ToothGrowth[ToothGrowth$supp=="OJ",]$len)
supp.VC <- basic.sum(ToothGrowth[ToothGrowth$supp=="VC",]$len)
dose.05 <- basic.sum(ToothGrowth[ToothGrowth$dose==0.5,]$len)
dose.10 <- basic.sum(ToothGrowth[ToothGrowth$dose==1.0,]$len)
dose.20 <- basic.sum(ToothGrowth[ToothGrowth$dose==2.0,]$len)

basic.mat <- rbind( total, supp.OJ, supp.VC, dose.05, dose.10, dose.20 )
print(basic.mat)
##             mean Std.Dev. median  min  max
## total   18.81333 7.649315  19.25  4.2 33.9
## supp.OJ 20.66333 6.605561  22.70  8.2 30.9
## supp.VC 16.96333 8.266029  16.50  4.2 33.9
## dose.05 10.60500 4.499763   9.85  4.2 21.5
## dose.10 19.73500 4.415436  19.25 13.6 27.3
## dose.20 26.10000 3.774150  25.95 18.5 33.9
TG.supp <- ggplot(ToothGrowth, aes(x=supp, y=len, fill=supp)) + 
            geom_bar(stat="summary", fun.y="mean", position="dodge")

TG.dose <- ggplot(ToothGrowth, aes(x=dose, y=len, fill=dose)) +
            geom_bar(stat='summary', fun.y='mean', position='dodge')

TG.supp.dose <- ggplot(ToothGrowth, aes(x=supp, y=len, fill=dose)) + 
            geom_bar(stat='summary', fun.y='mean', position='dodge')

TG.dose.supp <- ggplot(ToothGrowth, aes(x=dose, y=len, fill=supp)) +
            geom_bar(stat='summary', fun.y='mean', position='dodge')

grid.arrange(TG.supp, TG.dose, ncol=2)

grid.arrange(TG.supp.dose, TG.dose.supp, ncol=2)

  • There are 2 groups as the delivery method - OJ and VC - and 30 subjects in each group. By the dose of vitamin C(0.5, 1.0, 2.0), there are 3 groups and each group has 20 subjects.
  • The “OJ” group has longer odontoblasts length than “VC” group. (20.66 vs 16.96).
  • The length of odontoblasts becomes longer with increasing the vitamin C dose. - “0.5 dose” group has smallest (10.61) and “2.0 dose” group has largest (26.10).

Confidence intervals & hypothesis test to compare tooth growth by supp & dose

  • To compare the tooth growth by the groups(supp or dose) t.test()s are used, so confidence intervals & p-values are calculated

Comparison with supp (OJ vs VC)

t.test(len[supp=="OJ"], len[supp=="VC"])$p.value
## [1] 0.06063451
t.test(len[supp=="OJ"], len[supp=="VC"])$conf.int
## [1] -0.1710156  7.5710156
## attr(,"conf.level")
## [1] 0.95
  • Null hypothesis : 2 groups are not significantly different. Alternative hypothesis : 2 groups are significantly different.
  • The p-values are larger than 0.05, and the confidence interval contains 0(zero). When we suppose the significant level alpha=0.05, we can conclude that null hypothesis cannot be rejected.
  • Therefore, Group “OJ” and group “VC” are not significantly different.
  • Considering the mean of each group, orange juice seem to be more effective for odontoblasts growth than ascorbic acid, but it is not statistically significant.

Comparison with dose (0.5 vs 1.0 vs 2.0)

  • Because the dose has 3 groups, t.test() is not suitable for the group comparison. (t.test() is for 2 groups)
  • Therefore, p-values are calculated in each group(0.5 vs 1.0, 1.0 vs 2.0, 2.0 vs 0.5), then adjusted as the multiple testing correction.Bonferroni(FWER) or FDR(BH)
dose.pvalue <- c(t.test(len[dose==0.5], len[dose==1.0])$p.value, 
                t.test(len[dose==1.0], len[dose==2.0])$p.value,
                t.test(len[dose==0.5], len[dose==2.0])$p.value)
names(dose.pvalue) <- c("0.5 vs 1.0", "1.0 vs 2.0", "0.5 vs 2.0")
print(dose.pvalue)
##   0.5 vs 1.0   1.0 vs 2.0   0.5 vs 2.0 
## 1.268301e-07 1.906430e-05 4.397525e-14
p.adjust(dose.pvalue, method="bonferroni") 
##   0.5 vs 1.0   1.0 vs 2.0   0.5 vs 2.0 
## 3.804902e-07 5.719289e-05 1.319257e-13
p.adjust(dose.pvalue, method="BH")
##   0.5 vs 1.0   1.0 vs 2.0   0.5 vs 2.0 
## 1.902451e-07 1.906430e-05 1.319257e-13
dose.CI <- rbind(t.test(len[dose==0.5], len[dose==1.0])$conf.int, 
                t.test(len[dose==1.0], len[dose==2.0])$conf.int,
                t.test(len[dose==0.5], len[dose==2.0])$conf.int)
colnames(dose.CI) <- c("lower CI", "upper CI")
rownames(dose.CI) <- c("0.5 vs 1.0", "1.0 vs 2.0", "0.5 vs 2.0")
print(dose.CI)
##              lower CI   upper CI
## 0.5 vs 1.0 -11.983781  -6.276219
## 1.0 vs 2.0  -8.996481  -3.733519
## 0.5 vs 2.0 -18.156167 -12.833833
  • Null hypothesis : 3 groups are not significantly different. Alternative hypothesis : 3 groups are significantly different.
  • All p-values between 2 of 3 groups are less than 0.05, and confidence intervals do not contain 0(zero). In the significant level alpha=0.05, we can conclude that null hypothesis can be rejected.
  • Therefore, 3 groups are significantly different.
  • Considering the mean of each group, with increasing the dose of vitamin C, the lengths of odontoblasts become longer.

4. Conclusion