Statistics · Unit 4 · Week 14 · Lesson 43 · 15 minute reading

One Outcome, Several Predictors

An honest multivariable regression from a real environmental dataset.

By the end of this lesson, you should be able to

  • Write and interpret a multivariable linear regression formula.
  • Distinguish an adjusted association from a causal effect.
  • Explain how complete-case selection and correlated predictors complicate interpretation.

We began with a simple regression: one response, one predictor, one straight line. Real problems are usually less cooperative.

Ozone concentration, for example, may change with several weather conditions. A naive association between ozone and temperature does not tell us how that association behaves after accounting for wind or solar radiation.

That is one reason multivariable thinking belongs in an introductory course, not a distant graduate elective.

Begin with real measurements

R’s built-in airquality dataset records ozone, solar radiation, wind, and temperature in New York during May–September 1973. It also records month and day. The original measurement sites and times differ by variable; our model is therefore a description of a historical daily dataset, not a controlled physical experiment.

First, ask a question we can honestly answer:

Among the days with complete measurements, how does the fitted mean ozone level change with recorded temperature, holding the other included predictors fixed?

This is an adjusted association question. It is not automatically a causal one.

Multiple regression is still a regression

An additive model could be written as

E(Y∣X1,X2,X3)=β0+β1X1+β2X2+β3X3,E(Y\mid X_1,X_2,X_3) =\beta_0+\beta_1X_1+\beta_2X_2+\beta_3X_3,

where YY is ozone in parts per billion, X1X_1 is temperature in degrees Fahrenheit, X2X_2 is wind speed in miles per hour, and X3X_3 is solar radiation in Langleys.

In this model, the coefficient β1\beta_1 describes the difference in the model’s conditional mean ozone value associated with one additional degree Fahrenheit holding wind and solar radiation constant.

That conditional phrase matters. It is the primary difference between interpreting a simple slope and interpreting a coefficient in a multiple regression.

Fit two models in R

The first uses temperature alone:

data("airquality", package = "datasets")
simple <- lm(Ozone ~ Temp, data = airquality)
summary(simple)

The second adds wind and solar radiation:

multiple <- lm(Ozone ~ Temp + Wind + Solar.R,
               data = airquality)
summary(multiple)

These models use different sets of complete observations: the multiple regression also requires nonmissing solar radiation. Comparing their coefficients directly therefore changes both the covariates and the sample.

We can isolate the model-specification question by fitting both models on the same complete-case subset:

complete <- na.omit(airquality[c("Ozone", "Temp", "Wind", "Solar.R")])
simple_same <- lm(Ozone ~ Temp, data = complete)
multiple_same <- lm(Ozone ~ Temp + Wind + Solar.R, data = complete)
coef(simple_same)
coef(multiple_same)

Now the comparison controls the analysis sample. Coefficient changes can still reflect correlated predictors, sampling variation, or model choices; they are not by themselves causal effects.

What about seasonality?

The dataset covers five months, not an entire year. Weather conditions, measurement patterns, and ozone concentrations can change over the season.

One possible exploratory extension adds month as a categorical predictor:

with_month <- lm(Ozone ~ Temp + Wind + Solar.R + factor(Month),
                 data = airquality)
summary(with_month)

This includes additional additive terms. It does not prove that we have fully adjusted for seasonality, nonlinearity, dependence between adjacent days, or all sources of confounding.

Questions before conclusions

A responsible analysis should ask whether there are extreme observations, whether residuals show curvature, whether error spread varies, whether daily observations are independent enough for the intended inference, and whether the historical measurement process supports the interpretation.

In particular, adding more predictors is not a mechanical path toward truth. Variables can be correlated, some may be consequences of others, and a high in-sample R2R^2 does not guarantee valid predictions outside the observed conditions.

The R Workbench example accompanying this lesson executes the missing-data audit, compares the models on a common sample, and displays plots. Change one assumption or formula at a time; record what changes and what remains uncertain.

Exercise

  1. In the additive model, how should a temperature coefficient be interpreted?
  2. Why compare simple and multiple models on a common set of complete observations?
  3. Why is neither of these observational models sufficient to estimate the causal effect of changing the weather?
Suggested responses
  1. As an adjusted association in the conditional mean ozone concentration per Fahrenheit degree, holding the other included predictors fixed, in the context of the fitted model.

  2. Otherwise the coefficient difference may reflect both added predictors and a change in which dates were included.

  3. The measurements were observational, potential confounding and dependence remain, and statistical adjustment alone does not establish a well-defined intervention or exchangeability.

Provenance

The dataset is bundled with base R, not copied into this repository. Consult the official R dataset documentation for the variable definitions, units, sources, and historical context. For why multivariable thinking belongs in introductory statistics, consult ASA GAISE Recommendation 5.

Keep the analysis sample fixed when comparing models

A model with more predictors can omit more records because it needs more nonmissing variables. To ask whether adding a predictor changes a coefficient or fit, first build a common complete-case mask using every variable needed by either model. Fit both models to that same subset, then report how the restriction differs from analyses using each model’s maximum available data. Otherwise a coefficient change can reflect new adjustment, a changed sample, or both.

In a multiple linear model Y=β0+β1X1+β2X2+εY=\beta_0+\beta_1X_1+\beta_2X_2+\varepsilon, the coefficient β1\beta_1 describes a conditional mean difference per unit of X1X_1 holding X2X_2 fixed under the model. It is not generally the coefficient from a separate bivariate fit. If predictors are correlated, their shared information and available combinations affect both estimation and uncertainty. A hypothetical comparison requiring combinations absent from the data may amount to extrapolation even when each individual variable lies within its marginal observed range.

The historical air-quality observations are ordered in time. Seasonal pattern and serial dependence should be inspected, not discarded by treating rows as interchangeable. A conventional lm summary does not test every design assumption. Also distinguish a prediction for a new day’s outcome from an estimated conditional mean; the former includes day-to-day residual variability.

Further practice

  1. Write the purpose of a common complete-case mask in one sentence.
  2. Explain what is being held fixed when interpreting an adjusted temperature coefficient.
  3. Suggest one sensitivity analysis that does not pretend the data constitute a randomized environmental experiment.
Worked further responses
  1. It holds the analyzed observations constant so a model comparison is not confounded by different row inclusion rules.
  2. The other included model predictors, with interpretation depending on their specification and observed support.
  3. Compare a time-adjusted model, inspect residuals by date, test a justified nonlinear mean term, or report sensitivity to influential days while preserving provenance and observational limits.
Your study progress · Optional

Keep your place

Mark this lesson complete after you've read it, attempted its exercises, and explained its central idea in your own words.

Progress is not saved unless you choose to mark the lesson complete.

Saved only in this browser's local storage. No required account, server transmission, or analytics. You can reset your saved progress on the course page. Clearing browser data also clears the record.