This document will provide some exploratory data analysis with the ToothGrowth data in the R datasets library and some confidence iterval and/or hypothesis testing along with their subsequent conclusions.

ToothGrowth Data

library(datasets)
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 ...

Exploratory Plot

95% Confidence Intervals

ML = mean(ToothGrowth$len)
ML
## [1] 18.81333
n = 60
ML + c(-1,1)*qnorm(.975)*sd(ToothGrowth$len)/sqrt(n)
## [1] 16.87783 20.74884

Hypothesis Testing

Null hypothesis, H0 is that the mean of tooth growth is ML (18.81333)

Tooth growth by Supp

Supp - OJ

MLO = mean(ToothGrowth$len[ToothGrowth$supp=="OJ"])
MLO
## [1] 20.66333

Supp - VC

MLV = mean(ToothGrowth$len[ToothGrowth$supp=="VC"])
MLV
## [1] 16.96333

Since both values are between the 95% confidence interval, we can still assume our Null hypothesis is true

Tooth growth by Dose

Dose - 0.5

MLD = mean(ToothGrowth$len[ToothGrowth$dose==0.5])
MLD
## [1] 10.605

Dose - 1.0

MLD1 = mean(ToothGrowth$len[ToothGrowth$dose==1.0])
MLD1
## [1] 19.735

Dose - 2.0

MLD2 = mean(ToothGrowth$len[ToothGrowth$dose==2.0])
MLD2
## [1] 26.1

Both the 0.5 and 2.0 dose means are out of our 95% confidence interval. Because that is two out of the three dose values, I would think our null hypothesis needs to be further examined.