- Hypothesis testing is a method of making decisions or inferences about a population based on sample data.
- It involves comparing two competing hypotheses: the null hypothesis (\(H_0\)) and the alternative hypothesis (\(H_1\)).
2024-10-21
\[ H_0: \mu = \mu_0 \quad \text{vs} \quad H_1: \mu \neq \mu_0 \]
In this example, we are comparing two groups: a control group and a treatment group. The control group represents individuals who did not receive a particular treatment, while the treatment group represents those who did. We are interested in seeing if the treatment had a significant effect on the outcome, represented by the values.
ggplot(data, aes(x = Group, y = Value, fill = Group)) + geom_boxplot() + labs(title = "Control vs. Treatment Groups", y = "Value")
## ## Welch Two Sample t-test ## ## data: treatment and control ## t = 6.0718, df = 97.951, p-value = 2.406e-08 ## alternative hypothesis: true difference in means is not equal to 0 ## 95 percent confidence interval: ## 0.7485609 1.4754485 ## sample estimates: ## mean of x mean of y ## 6.146408 5.034404
The following interactive plot shows the rejection regions for a two-tailed hypothesis test. The rejection regions are the areas beyond the critical values, where we would reject the null hypothesis.
The following plot shows a comparison of the control and treatment groups, including individual data points and boxplots for each group.