In: Statistics and Probability
Consider the ToothGrowthdata in R, concerning the Effect of Vitamin C on Tooth Growth in Guinea Pigs. : determine whether there is a significant difference in the proportions of the two groups classified as “HIGH” using a suitable test and a 95% confidence interval. and taking into account “dose”, and comment on the results.
Please find below the R code with output and comments. The R code is given in 'red' which you need to run in R-studio.
We evoke the dataset ToothGroth in R and explore the data using summary, head, dim and str functions.
The data has 60 observations and 3 variables - len (numeric) 2. supp (factor, VC/OJ) 3. dose (numeric) - Dose in milligrams
Now we will plot the scatter plot of tooth length against dose.
Positive effect of the dose, as the dosage increases the tooth growth increases. In the specific case of the VC, the tooth growth has a linear relationship with dosage. The higher dossage (2.0mg) has less improvement in tooth growth with the OJ supplement. However, the OJ supplement generally induces more tooth growth than VC except at higher dosage (2.0 mg).
Hypothesis Testing
Assumptions
The variables must be independent and identically distributed (i.i.d.).
Variances of tooth growth are different when using different supplement and dosage.
Tooth growth follows a normal distribution.
Hypothesis for the supplement OJ vs VC
Let our null hypothesis to be there is no difference in tooth growth when using the supplement OJ and VC.
lenOJ=lenVC
Let our alternate hypothesis to be there are more tooth growth when using supplement OJ than VC.
lenOJ>lenVC
We will perform a t-test following the indications of the work to be evaluated.
One-tailed independent t-test with unequal variance.
As the p-value (0.03032) is lower than 0.05 (the default value for the tolerance of the error alpha), then, we reject the null hypothesis. That can be interpreted as there is aproximately 3% of chance of obtain an extreme value for the difference in mean of tooth growth.
Finally, based on this low p-value, we can conclude that it is very likely that supplement OJ, the greater the effect on tooth growth than supplement VC.
Hypothesis for the dossage
The null hypothesis is that there is no difference in tooth growth between dosage. Our alternate hypothesis is that there are more tooth growth when the dosage increases.
One-tailed independent t-test with unequal variance.
As the p-value (6.342e-08) is lower than 0.05 (the default value for the tolerance of the error alpha), then, we reject the null hypothesis. That can be interpreted as there is almost null chances of obtain an extreme value for the difference in mean of those dossages (doseHalf < doseOne) on the tooth growth.
The conclusion is similar than the previous, the p-value is 9.532e-06, close to 0. Then we reject the null hypothesis. That can be interpreted as there is almost null chances of obtain an extreme value for the difference in mean of those dossages (doseOne < doseTwo) on the tooth growth. The value is extrem (that’s what we reject the null hypothesis)
Finally, based on these low p-values, we can conclude that it is very likely that dossage has effect, and a higher dossage higher tooth growth.
Overall study conclusions:
There is sufficient evidence for the hypothesis that supplements have different mean effects. Higher sample size is needed to improve the significance of this result.
There is strong evidence for the alternate hypothesis that mean dose effects do have differences.
There is strong evidence for the alternate hypothesis that the mean supplement effects (OJ vs VC) do differ for low and medium doses.
There is strong evidence for the null hypothesis that the mean supplement effects (OJ vs VC) do not differ for high doses. Thus we reject the alternate hypothesis at high doses.
There is strong evidence for the hypothesis that OJ has actually higher mean effect than VC for low and medium doses