2024-03-20

What is Hypothesis Testing

  • statistical tool that helps identify is the results of an experiment are meaningful
  • uses hypotheses to determine results
  • z = (\(\overline{x}\) - \(\mu\)) / \(\sigma\)

How it can be used

  • we could use hypothesis testing to see the effect that vitamin C has on tooth growth in Guinea pigs
  • this data can be found using the dataset 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

Data Visualization

box plot using ggplot - shows the tooth growth based on the way the vitamin c was given and the amount

## Warning: package 'ggplot2' was built under R version 4.3.3

Data Visualizations

shows the dose level and the length that their teeth grew and color codes the two ways that they gave the pigs their dose - ggplot(ToothGrowth, aes(x = dose, y = len)) + geom_point(aes(color = supp))

Data Visualization

scatterplot 3D - shows the tooth growth versus the way they were given the vitamin doses and the amount that they had

## Warning: package 'plotly' was built under R version 4.3.3

Calculations

  • for when the dose level is 0.5
  • z = (\(\overline{x}\) - \(\mu\)) / \(\sigma\)
  • \(\overline{x}\) = 18.8
  • \(\mu\) = 13.23
  • \(\sigma\) = 4.45 so z = 1.25

Review

  • the hypothesis was that the different ways of the supplement would result in a change in the tooth growth of the guinea pigs
  • since the p-vale of the data is .007 and the confidence level 2.02 there is a difference in the methods used