Tooth_Growth Data :
head(ToothGrowth)
## len supp dose
## 1: 4.2 VC 0.5
## 2: 11.5 VC 0.5
## 3: 7.3 VC 0.5
## 4: 5.8 VC 0.5
## 5: 6.4 VC 0.5
## 6: 10.0 VC 0.5
qplot(len, data=ToothGrowth, facets = dose~supp, fill = dose, binwidth = 1)
Histogram according to each of the variables; Vehicle & Dosage
Mean of the data
Dose | OJ | VC | Total |
---|---|---|---|
0.5 | 13.23 | 7.98 | 21.21 |
1 | 22.70 | 16.77 | 39.47 |
2 | 26.06 | 26.14 | 52.20 |
Variance of the data
Dose | OJ | VC | Total |
---|---|---|---|
0.5 | 19.889000 | 7.544000 | 27.43300 |
1 | 15.295556 | 6.326778 | 21.62233 |
2 | 7.049333 | 23.018222 | 30.06756 |
From the above plots it’s clear that though the mean is high for Orange Juice OJ
it also has large variance relative to Ascorbic acid VC
. Also one can see that as the dose increases we can see more growth. We can see if this increase in growth is significant in the following sections.
Let us now see if the difference between the 2 administration methods are significantly different from each other using a 2 sample T-test. Since the variance doesn’t seem equal from the above table we will also do Welch T-Test (In t.test Fn set this param var.equal = FALSE
)
Assumptions
len
variable follows a T distribution.Ho : Mean length of OJ > Mean length of VC
.Ha : Mean length of OJ !> Mean length of VC
.##
## Welch Two Sample t-test
##
## data: Adm_df[, 2] and Adm_df[, 1]
## t = 2.7318, df = 112.53, p-value = 0.003657
## alternative hypothesis: true difference in means is greater than 0
## 95 percent confidence interval:
## 1.453726 Inf
## sample estimates:
## mean of x mean of y
## 20.66333 16.96333
< 0.05
we can reject the Ho hypothesis
with 95% confidence as there is only a 0.3657233% chance of the difference observed (between OJ & VC) being from Null distribution.Conclusion :
Orange juice 'OJ'
delivery of Vitamin C has shown significant growth of odontoblasts compared to Ascorbic acid 'VC'
Let us now see if the difference between the different dosages are significant from each other using a 2 sample T-test. Since the variance doesn’t seem equal from the above table we will also do Welch T-Test (In t.test Fn set this param var.equal = FALSE
)
Assumptions - Since the sample size is small we will assume the len
variable follows a T distribution.
- Variance also is high between the 2 groups hence the Welch test with unequal variances.
1.) Dose 0.5 mg/day V/S Dose 1 mg/day
Ho : Mean length for 1mg/day dose > Mean length for 0.5mg/day
.Ha : Mean length for 1mg/day !> Mean length for 0.5mg/day
.D1 <- (ToothGrowth[dose == "0.5",1])$len
D2 <- (ToothGrowth[dose == "1",1])$len
D3 <- (ToothGrowth[dose == "2",1])$len
t.test(D2, D1, paired = FALSE, conf.level = 0.95, var.equal = FALSE, alternative = "greater")
##
## Welch Two Sample t-test
##
## data: D2 and D1
## t = 6.4766, df = 37.986, p-value = 6.342e-08
## alternative hypothesis: true difference in means is greater than 0
## 95 percent confidence interval:
## 6.753323 Inf
## sample estimates:
## mean of x mean of y
## 19.735 10.605
< 0.05
we can reject the Ho hypothesis
with 95% confidence as there is only a 6.341503610^{-6}% chance of the difference observed (between Dose 1 mg/day & Dose 0.5 mg/day) being from Null distribution.Conclusion :
Dose '1 mg/day'
of Vitamin C has shown significant growth of odontoblasts compared to Dose '0.5 mg/day'
2.) Dose 1 mg/day V/S Dose 2 mg/day
Since their mean lengths are close in values we will see if there is any difference in their means using a 2 sided hypothesis test.
Ho : Mean length for dose 1mg/day != Mean length of 2 mg/day
.Ha : Mean length for 1mg/day == Mean length of 2mg/day
.t.test(D3, D2, paired = FALSE, conf.level = 0.95, var.equal = FALSE)
##
## Welch Two Sample t-test
##
## data: D3 and D2
## 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:
## 3.733519 8.996481
## sample estimates:
## mean of x mean of y
## 26.100 19.735
< 0.05
we can reject the Ho hypothesis
with 95% confidence as there is only a 100% chance of the difference observed (between Dose 2 mg/day & Dose 1 mg/day) being from Null distribution.Conclusion :
Dose '2 mg/day'
of Vitamin C has shown significant growth of odontoblasts compared to Dose '1 mg/day'
Below conclusions satisfy p value cutoff of 0.05 or with 95% confidence we can say.
Dose '1 mg/day'
of Vitamin C has shown significant growth of odontoblasts compared to Dose '0.5 mg/day'
Dose '2 mg/day'
of Vitamin C has shown significant growth of odontoblasts compared to Dose '1 mg/day'
. Since dose 1 mg/day is greater than 0.5mg/day and 2mg/day > 1mg/day we can conclude the best dose to be 2mg/day.
Orange juice 'OJ'
delivery of Vitamin C has shown significant growth of odontoblasts compared to Ascorbic acid 'VC'
Note : All of the above inferences have been made assuming the groups are independent with unequal variances between the groups. Since the sample size was also small we assumed the variable follows T-distribution.