- A method to test assumptions about a population parameter
- Two types of hypotheses:
- Null Hypothesis (H0): No effect or difference
- Alternative Hypothesis (H1): Some effect or difference
- When testing, you can test one-tailed or two-tailed.
2025-03-06
Based of this ggplot, let’s focus on setosa and versicolor
data(iris) setosa_sepal <- iris$Sepal.Length[iris$Species == "setosa"] versicolor_sepal <- iris$Sepal.Length[iris$Species == "versicolor"] t.test(setosa_sepal, versicolor_sepal, var.equal = FALSE)
## ## Welch Two Sample t-test ## ## data: setosa_sepal and versicolor_sepal ## t = -10.521, df = 86.538, p-value < 2.2e-16 ## alternative hypothesis: true difference in means is not equal to 0 ## 95 percent confidence interval: ## -1.1057074 -0.7542926 ## sample estimates: ## mean of x mean of y ## 5.006 5.936