lm() — Linear regression

Draws the best straight line through a cloud of points.

lm(y ~ x)

Key idea

Definition

the predictor (what you know)
the predicted value
the intercept
the slope

Where you'd use it

Frequently asked questions

How do I read the slope?
The change in y for a one-unit increase in x.
Is a high R² enough?
No — check the residual plots, and remember correlation isn’t causation.