Analysis On the ToothGrowth Dataset - Statistical Inferences Report 2

Rithesh Kumar

September 2014

Assumptions

The dataset has clearly stated that all 3 dosages (0.5,1.0,2.0) of both the supplements (VC,OJ) have been given to the same set of 10 guinea pigs.

Hence, it is assumed that the data has been ordered for each supplement and dosage combination for each pig. That is, in the sequece of OJ and dose 0.5 for 1:10 pigs, then OJ and dose 1.0 for 1:10 pigs and so on and so forth.

Exploratory Plot Of ToothGrowth Data

library(ggplot2)
data <- ToothGrowth
for (i in 1:10) data[seq(i,60,by=10),"id"] <- i 
qplot(data=data,x=id,y=len,facets=.~dose,geom="point",colour=supp) + geom_line(aes(x=id,y=len)) + ggtitle("Length Of Tooth Of Pig Parametrized By Supplement and Dosage ")

plot of chunk unnamed-chunk-1

Plot Comparing The Supplements By Dosage For Each Pig (Shown as ID)

qplot(data=data,x=supp,y=len,colour=as.factor(id),group=id,facets=.~dose) + geom_line() + geom_point(shape=21,fill="white",size=3) + xlab("Supplement") + ylab("Length Of Tooth") + ggtitle("Plot Of Length Of Tooth Vs Supplement Used Split By Dosage")

plot of chunk unnamed-chunk-2

Hypothesis Tests And Confidence Intervals

Null Hypothesis : Mean tooth growth for group 1 (Supplement : OJ) = Mean tooth growth for group 2 (Supplement : VC)

Alternate Hypotheses : Mean tooth growth for group 1 (Supplement : OJ) > Mean tooth growth for group 2 (Supplement : VC)

Comparison Between The 2 Supplements For Dose = 0.5

g1 <- split(data,data$supp)$OJ
g2 <- split(data,data$supp)$VC
t.test(g1[which(g1$dose==0.5),]$len,g2[which(g2$dose==0.5),]$len,paired=TRUE)$conf.int
## [1] 1.263 9.237
## attr(,"conf.level")
## [1] 0.95
t.test(g1[which(g1$dose==0.5),]$len,g2[which(g2$dose==0.5),]$len,paired=TRUE)$statistic
##     t 
## 2.979

From the t-test results it is clear that Tooth Growth in Group 1 (Orange Juice With Dosage 0.5) is GREATER than Tooth Growth in Group 2 (Vitamin C With Dosage 0.5) as 95% confidence interval is completely > 0 and t quantile = 2.9791.

Therefore NULL HYPOTHESIS Is Rejected and ALTERNATE HYPOTHESIS is taken.

Comparison Between The 2 Supplements For Dose = 1.0

t.test(g1[which(g1$dose==1.0),]$len,g2[which(g2$dose==1.0),]$len,paired=TRUE)$conf.int
## [1] 1.952 9.908
## attr(,"conf.level")
## [1] 0.95
t.test(g1[which(g1$dose==1.0),]$len,g2[which(g2$dose==1.0),]$len,paired=TRUE)$statistic
##     t 
## 3.372

From the t-test results it is clear that Tooth Growth in Group 1 (Orange Juice With Dosage 1.0) is GREATER than Tooth Growth in Group 2 (Vitamin C With Dosage 1.0) as 95% confidence interval is completely > 0 and t quantile = 3.3721.

Therefore NULL HYPOTHESIS Is Rejected and ALTERNATE HYPOTHESIS is taken.

Comparison Between The 2 Supplements For Dose = 2.0

t.test(g1[which(g1$dose==2.0),]$len,g2[which(g2$dose==2.0),]$len,paired=TRUE)$conf.int
## [1] -4.329  4.169
## attr(,"conf.level")
## [1] 0.95
t.test(g1[which(g1$dose==2.0),]$len,g2[which(g2$dose==2.0),]$len,paired=TRUE)$statistic
##        t 
## -0.04259
t.test(g1[which(g1$dose==2.0),]$len,g2[which(g2$dose==2.0),]$len,paired=TRUE)$p.value
## [1] 0.967

From the t-test results it is clear that Tooth Growth in Group 1 (Orange Juice With Dosage 2.0) is approximately EQUAL to Tooth Growth in Group 2 (Vitamin C With Dosage 2.0) as 95% confidence interval contains 0 and t quantile = -0.0426.

Also, from the p value (0.967) it is highly likely that the NULL HYPOTHESIS is TRUE.

Therefore, NULL HYPOTHESIS is taken.

Conclusions - The Orange Juice Supplement Produces Greater Tooth Growth Than Vitamin C Supplement On Dosages 0.5,1.0 mg. However the Tooth Growth is almost similar for both supplements if dosage is 2.0 mg.