Introduction

Can height help predict someone’s arm span?

This example uses simple linear regression with:

  • Height is the explanatory variable, x.
  • Arm span is the response variable, y.
  • Both measurements are in centimeters.

Data

The PASeniors dataset has 500 Pennsylvania high-school seniors from Census at School (2023–2024). We randomly select 100 of the 466 complete measurement pairs.

data(PASeniors)
people <- PASeniors[, c("Height", "Armspan")]
people <- na.omit(people)
# Keep the same random sample each time
set.seed(301)
people <- people[sample(nrow(people), 100), ]
names(people) <- c("height", "armspan")

Scatterplot

The points mostly follow an upward trend, with a few farther from the line. The shaded area is a 95% confidence interval for mean arm span.

Regression Model

\[y_i = \beta_0 + \beta_1 x_i + \epsilon_i\]

  • \(y_i\) is arm span and \(x_i\) is height.
  • \(\beta_0\) is the intercept.
  • \(\beta_1\) is the slope.
  • \(\epsilon_i\) is the error for a person.

The slope describes the change in expected arm span for a 1 cm increase in height.

Fitting the Model

model <- lm(armspan ~ height, data = people)
round(coef(model), 3)
## (Intercept)      height 
##       2.941       0.978

\[\widehat{\text{arm span}} = 2.941 + 0.978(\text{height})\]

The slope is 0.978, so predicted arm span increases by almost 1 cm for each additional centimeter of height.

Model Fit

round(summary(model)$r.squared, 3)
## [1] 0.705

The model explains about 70.5% of the variation in arm span in this sample.

There is still some spread around the line, which is visible in the scatterplot.

Prediction Example

What is the predicted arm span for someone who is 170 cm tall?

new_person <- data.frame(height = 170)
round(predict(model, new_person), 1)
##     1 
## 169.2

\[\hat{y} = 2.941 + 0.978(170) \approx 169.2\text{ cm}\]

For this height, the predicted arm span is slightly shorter: about 169.2 cm.

Prediction Interval

round(predict(model, new_person,
              interval = "prediction"), 1)
##     fit   lwr   upr
## 1 169.2 155.6 182.9

The 95% prediction interval is about 155.6 to 182.9 cm for one new, comparable person.

That is a fairly wide range around the 169.2 cm prediction. Height alone leaves some uncertainty about one student’s arm span.

Interactive Plot

Hover over a point to see its measurements.

Residual Plot

Residual = observed arm span minus predicted arm span. Two points have residuals below -25 cm. The model overpredicts arm span for those students.

Checking the Model

The two large negative residuals stand out. Checking those measurements would be a useful next step before relying on the predictions.

The usual regression intervals assume independent, approximately normal errors with similar spread around a straight-line mean relationship.

These data are from high-school seniors who participated in Census at School. They cover heights from 147 to 198.1 cm.

Conclusion

Height gives a useful starting estimate of arm span in these 100 students. The fitted slope is close to 1, and the model explains about 70.5% of the variation.

For a height of 170 cm, the estimate is 169.2 cm, but individual measurements can be quite a bit above or below the line.

Source

American Statistical Association, U.S. Census at School.

PASeniors dataset in the Lock5Data R package, version 4.0.1. This version contains Pennsylvania high-school seniors from 2023–2024.

Project website

Package and dataset documentation

We remove 34 records missing arm span, then randomly select 100 of the remaining 466 records using seed 301. No other records are excluded.