Learn / Biostatistics / Correlation and linear regression
Simple linear regression
15 minute read · 6-question quiz
What you will learn
Fit and interpret a straight-line regression: slope, intercept, R² and residual SD
Use the model to predict, and avoid extrapolation
Check the main assumptions with residual plots
Correlation says how closely two variables move together. Regression goes further: it describes how much an outcome Y changes, on average, per unit change in a predictor X, and lets us predict.
The model
Y = β_0 + β_1 X + ε
β_0, the intercept, is the expected Y when X = 0 (often not meaningful on its own).β_1, the slope, is the expected change in Y for a one-unit increase in X.εis the error: the part of Y the line does not explain, assumed to have mean 0 and constant SD.
The line is chosen by least squares: it minimises the sum of the squared vertical distances (residuals) from the points to the line.
Confidence interval vs prediction interval
- The CI for the mean at a given X describes uncertainty in the average Y for people with that X.
- The prediction interval describes where a new individual's Y is likely to fall. It is much wider, as it includes the person-to-person scatter.
Assumptions (remember LINE)
- Linearity: the relationship is a straight line. Check the scatter plot and residual plot.
- Independence: observations are unrelated (violated by repeated measures or families).
- Normality of the residuals (matters little with large n; matters for prediction intervals in small samples).
- Equal variance (homoscedasticity): the scatter around the line is the same at all X.
Other practical points
- Centre X to make the intercept meaningful. If age is centred at 50, the intercept becomes the expected SBP at age 50 (136.0).
- A binary X (0 = placebo, 1 = treatment) turns regression into the t-test: the slope is the mean difference between groups, with the same p-value as the pooled t-test.
- Regression to the mean: extreme values tend to be less extreme when measured again. Patients enrolled because of very high BP will show a fall without any treatment. A control group is the cure.
- Transformations: modelling
ln Yturns slope coefficients into percentage changes (after exponentiating, ratios of geometric means).
Summary
Regression gives the average change in Y per unit of X (the slope) and lets you predict.
Least squares minimises squared residuals; R² is the share of variation explained.
Check linearity, independence, normal residuals and constant variance (LINE).
Do not extrapolate beyond the observed range of X.
A binary predictor in regression reproduces the two-sample t-test.
Check your understanding
Draft study guide. Spotted an error or something unclear? Tell us at hello@scintria.com. This is educational material, not clinical or regulatory advice.