Basic Inferential Data Analysis

  • Load the ToothGrowth data and perform some basic exploratory data analyses
  • Provide a basic summary of the data.
  • Use confidence intervals and/or hypothesis tests to compare tooth growth by supp and dose.
  • State your conclusions and the assumptions needed for your conclusions. ## Load the ToothGrowth data and perform some basic exploratory data analyses

Import Library

Use confidence intervals and/or hypothesis tests to compare tooth growth by supp and dose.

Hypothesis

1. By supplement

Run Two sample T-test with confidence level 95%

## 
##  Welch Two Sample t-test
## 
## data:  group1 and group2
## 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 of x mean of y 
##  20.66333  16.96333

2. By dose

Our case we know the value of dose which is 0.5,1,2.0. So we will run test twice between 0.5-1.0 and 1.0-2.0.

## 
##  Welch Two Sample t-test
## 
## data:  group_dose1 and group_dose2
## 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 of x mean of y 
##    10.605    19.735
## 
##  Welch Two Sample t-test
## 
## data:  group_dose2 and group_dose3
## 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 of x mean of y 
##    19.735    26.100

3. By supplement and dose

Our case we know the value of dose which is 0.5,1,2.0 and supplment are OJ and VC. So we will run test three.

## 
##  Welch Two Sample t-test
## 
## data:  group_dose_supp1 and group_dose_supp2
## t = 3.1697, df = 14.969, p-value = 0.006359
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  1.719057 8.780943
## sample estimates:
## mean of x mean of y 
##     13.23      7.98
## 
##  Welch Two Sample t-test
## 
## data:  group_dose_supp3 and group_dose_supp4
## t = 4.0328, df = 15.358, p-value = 0.001038
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  2.802148 9.057852
## sample estimates:
## mean of x mean of y 
##     22.70     16.77
## 
##  Welch Two Sample t-test
## 
## data:  group_dose_supp5 and group_dose_supp5
## t = 0, df = 18, p-value = 1
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -2.494589  2.494589
## sample estimates:
## mean of x mean of y 
##     26.06     26.06

State your conclusions and the assumptions needed for your conclusions.

From the T-test carried out folowing conclusions can be drawn

  • OJ supplement with 0.5 and 1.o mg dose has shown higher length than VC
  • VC and OJ has same implication on length when dose 2.0 mg