The p-value is defined as:
\[ p = P(T \geq t_0\mid H_0 \text{ is true}) \]
We test:
\[ H_0: \mu = \mu_0 \quad \text{vs.} \quad H_a: \mu \neq \mu_0 \]
Decision rule (for significance level \(\alpha = 0.05\)):
Suppose we measure exam scores for 30 students and test whether the mean score = 75.
[1] 77.52896
One Sample t-test
data: scores
t = 1.412, df = 29, p-value = 0.1686
alternative hypothesis: true mean is not equal to 75
95 percent confidence interval:
73.86573 81.19219
sample estimates:
mean of x
77.52896
Visualizing rejection regions for a two-sided t-test \((df=29)\):
ggplot(df_plot,
aes(x = x,
y = dens)) +
geom_line(color = "blue") +
geom_area(data = subset(df_plot,
is_tail),
aes(x = x,
y = dens),
fill = "red",
alpha = 0.5) +
labs(title = paste0("Rejection Region (alpha=0.05, df=",
dfree, ")"),
x = "t value",
y = "Density") +
theme_minimal()
Interactive visualization of p-value areas:
Just a 3D version of the information in slide 07
From the t-test:
- Test statistic: about 1.41
- p-value: about 0.169
Interpretation:
- If p-value < 0.05 → significant evidence against \(H_0\).
- Otherwise, no significant evidence.