- We use samples to learn about populations
- Main tools:
- Point estimation
- Confidence intervals
- Hypothesis testing
- Focus: Hypothesis Testing and p-value
\[ H_0: \text{Null hypothesis (no effect)} \] \[ H_1: \text{Alternative hypothesis (effect exists)} \]
Decision rule:
\[ \alpha = 0.05 \]
\[ p = P(\text{Data as extreme as observed} \mid H_0 \text{ is true}) \]
If p-value < 0.05 → Weight significantly affects MPG.
ggplot(mtcars, aes(wt, mpg)) +
geom_point(size=2) +
geom_smooth(method="lm", se=TRUE) +
labs(title="MPG vs Weight",
x="Weight (1000 lbs)",
y="Miles per gallon")
\[ \hat{\beta}_1 \pm t^* SE(\hat{\beta}_1) \]
95% CI for slope:
(-6.486, -4.203)