2025-06-10

Hypothesis Testing

  • Hypothesis Testing is a way in statistics to determine if a sample in a population has the proper evidence to support a claim.

Plotly Plot of Hypothesis Testing

First Ggplot

Second Ggplot

Hypothesis Testing Theorem Part 1

Two-Tailed Test, Left-Tailed Test, and Right-Tailed Test: \[ \begin{aligned} H_0 &: \mu = 50 \\ H_1 &: \mu \ne 50 \end{aligned} \] \[ \begin{aligned} H_0 &: \mu \ge 50 \\ H_1 &: \mu < 50 \end{aligned} \] \[ \begin{aligned} H_0 &: \mu \le 50 \\ H_1 &: \mu > 50 \end{aligned} \]

Hypothesis Testing Theorem Part 2

The Z statistic is used when the population standard deviation is known:

\[ Z = \frac{\bar{x} - \mu_0}{\sigma / \sqrt{n}} \]

R Code Showing Plotly Plot

  • x_vals = seq(-10, 10, length.out = 100)
  • y_vals = dt(x_vals, df = 60)
  • plot_ly(x = ~x_vals, y = ~y_vals, type = ‘scatter’, mode = ‘lines’,
  •    line = list(color = 'red')) %>%
  • layout(title = “T-distribution”,
  •    xaxis = list(title = "T-value"),
  •    yaxis = list(title = "Density"))