Positive slope: as \(x\) increases, \(y\) increases too.
Negative slope: as \(x\) increases, \(y\) decreases.
The form of an association is whether it follows a linear pattern, or some sort of more complicated pattern - periodic, polynomial (quadratic, cubic, etc.)
The strength of an association indicates how well the value of one variable can be predicted if you know the value of the other variable.
We can describe the strength and direction of a linear relationship using the correlation coefficient
“No case has been included in which the brain showed a condition which would have obviously affected its weight, nor have individuals with foreign or Jewish names been included.”
😱 This is not acceptable in 2026, yikes. But, in 1905, this was reasonable for science. 😬
Variables:
Brain weight is hard to measure (unless you’re dead)
Head circumference is easy to measure
Goal: Predict brain weight using head circumference
library(infer)
brain <- read_csv("head-brain.csv") |>
mutate(Gender = factor(Gender, labels = c("Male", "Female")))
brain_samples <- brain |>
rep_slice_sample(n = 100, replace = F, reps = 50) |>
nest(data = -replicate) |>
mutate(reg = map(data, ~lm(Brain ~ Head, data = .)),
coefs = map(reg, coef)) |>
unnest_wider(coefs)The sampled points produce different regression lines:
Call:
lm(formula = Brain ~ Head, data = brain)
Residuals:
Min 1Q Median 3Q Max
-175.98 -49.76 -1.76 46.60 242.34
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 325.57342 47.14085 6.906 4.61e-11 ***
Head 0.26343 0.01291 20.409 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 72.43 on 235 degrees of freedom
Multiple R-squared: 0.6393, Adjusted R-squared: 0.6378
F-statistic: 416.5 on 1 and 235 DF, p-value: < 2.2e-16
\[y = \beta_0 + \beta_1 x + \epsilon\] \[\hat y = \beta_0 + \beta_1 x\]
\(H_0:\) There is no relationship between \(x\) and \(y\) (substitute variables), e.g.
\(H_0: \beta_1 = 0,\) that is, there is no relationship between head circumference and brain weight.
\(H_A:\) There is a relationship between \(x\) and \(y\), e.g.,
\(H_A: \beta_1 \neq 0,\) that is, there is a relationship between head circumference and brain weight.
Call:
lm(formula = Brain ~ Head, data = brain)
Residuals:
Min 1Q Median 3Q Max
-175.98 -49.76 -1.76 46.60 242.34
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 325.57342 47.14085 6.906 4.61e-11 ***
Head 0.26343 0.01291 20.409 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 72.43 on 235 degrees of freedom
Multiple R-squared: 0.6393, Adjusted R-squared: 0.6378
F-statistic: 416.5 on 1 and 235 DF, p-value: < 2.2e-16
We reject \(H_0\) (t = 20.409, p < 0.0001) and conclude that it is more likely that there is a relationship between head size and brain weight. As head size increases by 1 cm, there is a corresponding increase in estimated brain weight of 0.263 grams.
\[\text{Estimate} \pm \text{Multiplier}\cdot\text{Std. Error}\]
Call:
lm(formula = Brain ~ Head, data = brain)
Residuals:
Min 1Q Median 3Q Max
-175.98 -49.76 -1.76 46.60 242.34
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 325.5734 47.1409 6.91 4.6e-11 ***
Head 0.2634 0.0129 20.41 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 72.4 on 235 degrees of freedom
Multiple R-squared: 0.639, Adjusted R-squared: 0.638
F-statistic: 417 on 1 and 235 DF, p-value: <2e-16
qnorm)We are 95% confident that the average population increase in brain weight (g) when head size increases by 1 cm is between 0.238 and 0.289.
