- Simple linear regression shows us the relationship between one explanatory variable and one response variable.
- In this example:
- \(x =\) Girth
- \(y =\) Volume
- Goal: Use tree trunk girth to help predict tree volume.
2026-03-07
Source: IBM, “What is linear regression?”
\[ \hat{y} = a + bx \]
\[ \widehat{\text{Volume}} = a + b(\text{Girth}) \]
\[ e = y - \hat{y} \]
\[ e^2 = ( y - \hat{y} )^2 \]
\[ \sum_{ i=1}^{n}(y_i - \hat{y}_i )^2 \]
\[ b = \text{change in predicted } y \text{ for a 1-unit increase in } x \]
\[ R^2 = \text{proportion of variation in } y \text{ explained by the regression model} \]
Source: Eurostat Glossary: Extrapolation
mod <- lm(Volume ~ Girth, data = trees) ggplot(trees, aes(x = Girth, y = Volume)) + geom_point(size = 2) + geom_smooth(method = "lm", se = FALSE) + theme_minimal()