This is the project that related to Tooth Growth. Data is available inside R.
This dataset about the length guinea pigs teeth after given either OJ or VC in doses of 0.5mg, 1.0mg or 2.0mg.
data("ToothGrowth")
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.000boxplot(len~supp, data=ToothGrowth, main="Boxplot of Tooth Length by OJ/VC", ylab="Tooth Length")ToothGrowth$dose=as.factor(ToothGrowth$dose)
boxplot(len~dose, data=ToothGrowth, main="Boxplot of Tooth Length by doses", ylab="Tooth Length")Summary: * 1st boxplot: The bulk of tooth lengths are in similar range when guinea pigs are given OC or VJ. The outliers for VC are spread across a wider range as compared to OJ. * 2nd boxplot: There is quite a shift in tooth length when guinea pigs are treated with different amount of doses. Those given 2.0mg have longer teeth, followed by 1.0mg and 0.5mg. Doses might have something to do with the tooth length
Comparing using the Two sample T-test on OJ and VC. Null hypotheses: No difference in tooth growth for OJ or VC.
t.test(len~supp, data=ToothGrowth)## 
##  Welch Two Sample t-test
## 
## data:  len by supp
## t = 1.9153, df = 55.309, p-value = 0.06063
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.1710156  7.5710156
## sample estimates:
## mean in group OJ mean in group VC 
##         20.66333         16.96333Results: * 95% Confidence Interval: (-0.171,7.571) * Interval: 0. T * Probability of difference of Tooth growth between using OJ or VC = maybe 0. * P-value (0.06) is greater than 0.05. * Insufficient evidence to reject the null hypothesis.
Next is to compared by doses. As hypothesised by the boxplot above, it is expected that the true difference for the doses to not be 0. As the doses come in three levels, need to compare those with 0.5mg and 1.0mg.
t.test(len~dose, data=ToothGrowth[ToothGrowth$dose==0.5|ToothGrowth$dose==1.0,])## 
##  Welch Two Sample t-test
## 
## data:  len by dose
## t = -6.4766, df = 37.986, p-value = 1.268e-07
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -11.983781  -6.276219
## sample estimates:
## mean in group 0.5   mean in group 1 
##            10.605            19.735Results: * 95% Confidence Interval: (-11.984,-6.276) * No 0 in it which supports the claim that the true difference is not 0. * Small p-value which is smaller than 0.05. * Sufficient evidence to reject the null hypothesis of the true difference being 0.
Next is to compare between doses of 1.0mg and 2.0mg.
t.test(len~dose, data=ToothGrowth[ToothGrowth$dose==2.0|ToothGrowth$dose==1.0,])## 
##  Welch Two Sample t-test
## 
## data:  len by dose
## t = -4.9005, df = 37.101, p-value = 1.906e-05
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -8.996481 -3.733519
## sample estimates:
## mean in group 1 mean in group 2 
##          19.735          26.100Results: * Similar to the previous t-test which shows that doses do indeed affect Tooth Growth.
The values of Tooth Growth can be tested for normality under the Shapiro-Wilks test.
If the doses of these supps are heavier, their teeth will be prone to grow longer.