Synopsis

In this analysis, the ToothGrowth dataset, containing data on tooth growth in guinea pigs, was explored and summarized. The dataset has two variables: tooth length (len) and supplement type (supp), with either vitamin C (VC) or orange juice (OJ) as supplements. The data is divided across three different dose levels: 0.5, 1, and 2 mg/day. Initial exploration of the dataset showed an increase in tooth growth with increasing dose levels for both supplement types, but the differences between the supplement types were less clear. To investigate this further, three independent t-tests were performed to compare tooth growth between the supplement types at each dose level.

The results of the t-tests indicated no significant difference in tooth growth between vitamin C and orange juice supplements at any of the three dose levels. To interpret these results, some assumptions were made, including the independence and random sampling of the data, normal distribution of tooth growth measurements within each group, and equal variances of tooth growth measurements between the groups.

Data Summary

The dataset, ToothGrowth, comprises 60 data points detailing tooth development in guinea pigs. It includes two variables: tooth length (len) and supplement type (supp), with the supplements being either vitamin C (VC) or orange juice (OJ). The study examines three distinct dosage levels: 0.5, 1, and 2 mg/day.

Upon analyzing the data, it was found that the average tooth length is 18.81, ranging from a minimum of 4.20 to a maximum of 33.90. The dataset is equally divided between the two supplement types, with each having 30 observations for both vitamin C and orange juice.

The boxplots show that tooth growth appears to increase with the dose level for both supplement types. However, the differences between the two supplement types are not as clear.

# Load necessary libraries
library(datasets)
library(ggplot2)

# Load the ToothGrowth data
data(ToothGrowth)

# Perform basic exploratory data analyses
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.000
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 ...
head(ToothGrowth)
# Visualize the data
ggplot(ToothGrowth, aes(x = supp, y = len, fill = as.factor(dose))) +
    geom_boxplot(outlier.size = 2, outlier.shape = 21, outlier.fill = "white", outlier.stroke = 1, alpha = 0.8, lwd = 1.2) +
    labs(title = "Tooth Growth by Supplement and Dose", x = "Supplement (supp)", y = "Tooth Length (len)", fill = "Dose") +
    scale_fill_brewer(palette = "Spectral", labels = c("0.5 mg/day", "1 mg/day", "2 mg/day")) +
    theme_minimal() +
    theme(plot.title = element_text(size = 18, face = "bold", hjust = 0.5),
          axis.title.x = element_text(size = 14, face = "bold"),
          axis.title.y = element_text(size = 14, face = "bold"),
          axis.text = element_text(size = 12),
          legend.title = element_text(size = 14, face = "bold"),
          legend.text = element_text(size = 12),
          legend.background = element_rect(fill = "white", color = "black", size = 1.2),
          panel.grid.major = element_line(color = "gray80")) +
    scale_x_discrete(labels = c("VC" = "Vitamin C", "OJ" = "Orange Juice"))

Testing Our Hypotheses

When comparing tooth growth in relation to supplement types across varying doses, three individual t-tests were carried out. The results are presented below:

# Perform t-tests to compare tooth growth by supp and dose
ttest_results <- with(ToothGrowth, t.test(len ~ supp, paired = FALSE, subset = dose == 0.5))
print(ttest_results)
## 
##  Welch Two Sample t-test
## 
## data:  len by supp
## t = 3.1697, df = 14.969, p-value = 0.006359
## alternative hypothesis: true difference in means between group OJ and group VC is not equal to 0
## 95 percent confidence interval:
##  1.719057 8.780943
## sample estimates:
## mean in group OJ mean in group VC 
##            13.23             7.98
ttest_results <- with(ToothGrowth, t.test(len ~ supp, paired = FALSE, subset = dose == 1))
print(ttest_results)
## 
##  Welch Two Sample t-test
## 
## data:  len by supp
## t = 4.0328, df = 15.358, p-value = 0.001038
## alternative hypothesis: true difference in means between group OJ and group VC is not equal to 0
## 95 percent confidence interval:
##  2.802148 9.057852
## sample estimates:
## mean in group OJ mean in group VC 
##            22.70            16.77
ttest_results <- with(ToothGrowth, t.test(len ~ supp, paired = FALSE, subset = dose == 2))
print(ttest_results)
## 
##  Welch Two Sample t-test
## 
## data:  len by supp
## t = -0.046136, df = 14.04, p-value = 0.9639
## alternative hypothesis: true difference in means between group OJ and group VC is not equal to 0
## 95 percent confidence interval:
##  -3.79807  3.63807
## sample estimates:
## mean in group OJ mean in group VC 
##            26.06            26.14

Conclusion

These findings suggest that, for the 0.5 mg/day and 1 mg/day dose levels, there are marked distinctions in tooth growth between the vitamin C and orange juice supplements. However, at the 2 mg/day dose level, no significant difference in tooth growth occurred between the vitamin C and orange juice supplements.

Assumptions

To interpret these results, some assumptions were made as follows: