Simple Linear
Regression
Learn to fit the best-fit line to biological data, interpret the slope and intercept, and assess model quality with \( r^2 \).
What Is Regression?
In biology and health sciences, we often want to understand how one variable predicts another. For example: does increasing a drug dosage predict a larger reduction in blood pressure?
Simple linear regression fits a straight line through a scatterplot of data to model the relationship between an explanatory variable \( x \) and a response variable \( y \).
Key Vocabulary
Visualizing Data with a Scatterplot
Each dot is one observation. The dashed line is the regression line: it captures the overall linear trend from low dosage to high dosage.
The Regression Equation
The Least Squares Method
The best-fit line minimizes the sum of squared residuals: the total squared vertical distance between each data point and the line.
The dashed red segments are residuals. Squaring them penalizes large errors more than small ones, producing a line that balances all predictions.
Computing \( b_1 \) and \( b_0 \)
Correlation vs Regression
| Correlation \( r \) | Regression | |
|---|---|---|
| Purpose | Measures strength and direction of linear association | Models the relationship to make predictions |
| Output | A single number: \( -1 \leq r \leq 1 \) | An equation: \( \hat{y} = b_0 + b_1 x \) |
| Symmetry | \( r_{xy} = r_{yx} \) | Regressing \( y \) on \( x \) differs from \( x \) on \( y \) |
| Units | Unitless | Slope has units: \( \text{units of } y / \text{units of } x \) |
Interpreting \( r^2 \)
\( r^2 \) is the coefficient of determination. It tells you the proportion of the variability in \( y \) that is accounted for by the linear relationship with \( x \).
Step-by-Step: Fitting a Regression
Example 1: Plant Growth
A botanist records sunlight hours (\( x \)) and stem height in cm (\( y \)) for 8 plants. Summary statistics:
Example 2: Predicting a Value
Using the plant growth model \( \widehat{\text{height}} = 0.5 + 2.25x \), predict the height for a plant receiving 8 hours of sunlight.
Now suppose you want to predict height for a plant receiving 15 hours. Is that reasonable?
Example 3: Reading a Residual Plot
A good residual plot shows points scattered randomly around the zero line with no pattern. If you see a curve or fan shape, the linear model is not appropriate.
Common Mistakes
Regression Cheat Sheet
| Concept | Symbol | Interpretation |
|---|---|---|
| Slope | \( b_1 \) | Change in \( \hat{y} \) per unit increase in \( x \) |
| Intercept | \( b_0 \) | Predicted \( y \) when \( x = 0 \) |
| Correlation | \( r \) | Strength and direction of linear association (\( -1 \) to \( 1 \)) |
| Coefficient of determination | \( r^2 \) | Proportion of variance in \( y \) explained by the model |
| Residual | \( e_i = y_i - \hat{y}_i \) | Observed minus predicted: positive = underestimate |
| Least squares criterion | \( \min \sum e_i^2 \) | The line minimizes total squared error |
Question 1 of 5
A regression equation is \( \hat{y} = 12 + 3.5x \). What does the slope of \( 3.5 \) mean?
Question 2 of 5
If \( r = -0.80 \), what is \( r^2 \) and what does it tell us?
Question 3 of 5
A study finds \( \bar{x} = 50 \), \( s_x = 10 \), \( \bar{y} = 200 \), \( s_y = 40 \), and \( r = 0.75 \). What is the slope \( b_1 \)?
Question 4 of 5
A patient's observed cholesterol is 220 mg/dL and the regression model predicts 205 mg/dL. What is the residual?
Question 5 of 5
A residual plot shows a clear U-shaped curve. What should you conclude?