This report evaluates the effect of different supplements delivery methods of vitamin C (as absorbic acid and orange juice) on odontoblast tooth growth on guinea pigs. It also examines if difference doses of the delivery methods of vitamin c yield different tooth growth. The datatset evaluated in this report, “ToothGrowth”, is found in the “datasets” package, and this report was prepared by the “knitr” package.
The dataset “ToothGrowth” was loaded, and its dimensions and variables’ names evaluated.
library(datasets)
data (ToothGrowth)
dim (ToothGrowth)
## [1] 60 3
names(ToothGrowth)
## [1] "len" "supp" "dose"
From the above code, we notice that the data set has 3 variables and 60 observations.
Descriptive statistic was performed to understand how the observations of the variables were grouped (e.g. numeric [discrete, continuous], character, factor, etc.).
str(ToothGrowth)
## 'data.frame': 60 obs. of 3 variables:
## $ len : num 4.2 11.5 7.3 5.8 6.4 10 11.2 11.2 5.2 7 ...
## $ supp: Factor w/ 2 levels "OJ","VC": 2 2 2 2 2 2 2 2 2 2 ...
## $ dose: num 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 ...
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
From the summary information above, the three of the variables are reported as follows: a) len = tooth length, which is reported as numeric (continuous) b) supp = vitamin C supplements delivery methods (OJ = orange juice, VC = absorbic acid, which is a concentrated “pure” form of vitamin C), and were documented as factors c) dose = milligrams by which the delivery methods were administered, and reported numeric (discrete into three levels: minimum = 0.5 mg, median = 1 mg, maximum = 2 mg)
Two histograms were prepared to evaluate the distribution of the observations per dose and delivery method.
library(ggplot2)
library(gridExtra)
plotdose <- ggplot(ToothGrowth, aes(x=len)) + geom_histogram(binwidth=1, colour="black", fill="grey") +
facet_grid(dose ~ .) + ggtitle("Distribution Per Dose")
plotsupp <- ggplot(ToothGrowth, aes(x=len)) + geom_histogram(binwidth=1, colour="black", fill="grey") +
facet_grid(supp ~ .) + ggtitle("Disitrubion per Supplement Delivery Method")
grid.arrange(plotdose,plotsupp,nrow=1,ncol=2)
From the histograms above, the distribution of values seems to increases per increasing dose. With supplement, the distribution seems to be more concentrated with the supplement orange juice.
The null hypothesis is that Vitamin C supplements yields the same tooth length in guinea pigs through absorbic acid (VC) and orange juice (OJ). The alternative hypothesis is that the delivery method differ in the tooth length they yield in guinea pigs.
The second null hypothesis is that the three doses of vitamin C yield the same tooth length in guinea pigs. The alternative hypothesis is that different doses differ in the tooth length they yield in guinea pigs
To evaluate the hypothesis related to delivery methods (i.e. hypothesis #1), a paired t-test was performed to compare the delivery methods .
suppVC <- subset (ToothGrowth, supp=="VC")
suppOJ <- subset (ToothGrowth, supp=="OJ")
t.test(suppVC$len, suppOJ$len, paired=TRUE)
##
## Paired t-test
##
## data: suppVC$len and suppOJ$len
## t = -3.3026, df = 29, p-value = 0.00255
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -5.991341 -1.408659
## sample estimates:
## mean of the differences
## -3.7
From the paired t-test above, we reject the null hypothesis that both delivery methods of vitamin C yield similar tooth lengths, with orange juice yielding higher values of tooth lengths.
To evaluate the hypothesis related to different doses (i.e. hypothesis #2), a paired t-test was performed. A function was created to apply the t.test to the three different doses and taking into consideration the different delivery methods.
library(pander)
hp <- lapply(c(.5, 1, 2), function(x) {
t.test(len ~ supp, data=subset(ToothGrowth, dose==x), paired=TRUE, var.equal=FALSE)
})
pvalues <- c(hp[[1]]$p.value, hp[[2]]$p.value, hp[[3]]$p.value)
tstatistic <- c(hp[[1]]$statistic, hp[[2]]$statistic, hp[[3]]$statistic)
padjusted <- p.adjust(pvalues, method = "bonferroni")
CIlower <- sapply(c(hp[[1]]$conf.int[1], hp[[2]]$conf.int[1], hp[[3]]$conf.int[1]),
round, 3)
CIupper <- sapply(c(hp[[1]]$conf.int[2], hp[[2]]$conf.int[2], hp[[3]]$conf.int[2]),
round, 3)
Results <- data.frame(dose=c(0.5, 1, 2), t=tstatistic, p=pvalues, adj=padjusted,
ci=paste0("[",paste(CIlower, CIupper, sep=", "), "]"))
colnames(Results) <- c("Dose", "t", "p-value", "adj. p-value", "Confidence Intervals")
pander(Results, round=3, split.tables=120,
caption="**Two-sided Comparison of Doses (0.5 mg, 1 mg, 1 mg**")
| Dose | t | p-value | adj. p-value | Confidence Intervals |
|---|---|---|---|---|
| 0.5 | 2.979 | 0.015 | 0.046 | [1.263, 9.237] |
| 1 | 3.372 | 0.008 | 0.025 | [1.952, 9.908] |
| 2 | -0.043 | 0.967 | 1 | [-4.329, 4.169] |
An histogram, in which Doses and Deliver Methods were plotted against tooth length, was elaborated.
library(ggplot2)
ggplot(data=ToothGrowth, aes(y=len, x=supp, fill=supp)) + geom_boxplot() +
facet_wrap(~ dose, ncol=3) + ylab("Tooth Length") + xlab("Delivery Method") +
ggtitle("Comparison of Tooth Growth by Dose (0.1, 1, 2 mg) and Delivery Method") +
stat_summary(fun.y=mean, geom="point", shape=5, size=2)
From the graph above, we can see that orange juice yields higher values of tooth lengths as previously tested in the first hypothesis. We can also see an increase increasing tooth length with Dose. Although there is noticeable difference in magnitude between delivery methods, with orange juice the increasing effect seem to not be as large from 1 mg to 2 mg. This is contrary to the change seen from 0.5 to 1 mg. This same pattern is observed with absorbic acid as the delivery method, except that the magnitude of increase is comparable in both from 0.5 to 1 and from 1 to 2 mg.
Both delivery methods yield increasing tooth growth with increasing doses, and this increase seems to be more noticeable with orange juice as the delivery method. At the higher doses, both delivery methods reported similar tooth lengths growth.