AP Statistics · Unit 5: Regression Analysis
5.9 Transforming Data for a Linear Model
Why transform data?
When a scatterplot shows a curved (nonlinear) pattern, a straight-line model is inappropriate. Transformations apply a mathematical function (like log, square root, or reciprocal) to x and/or y to straighten the pattern, so least-squares regression on the transformed data becomes valid and residuals become more randomly scattered.
Common transformations
For exponential growth patterns, take the log of y (log(y) vs. x); this works because exponential functions have a constant percent change, and logs turn multiplicative growth into linear growth. For power models, take the log of both x and y (log(y) vs. log(x)); this works because power functions have a constant ratio of log(y) to log(x).
Checking the transformed model
After transforming, refit the linear regression and check the residual plot for the transformed data — it should show no pattern and small, scattered residuals. A higher r² and linear residual scatter confirm the transformation improved the fit. To predict y, remember to back-transform (undo the log) your predicted value.
Key terms
- Transformation (in regression)
- Applying a mathematical function (log, square root, reciprocal, etc.) to x and/or y to make a nonlinear relationship linear.
- Linearizing an exponential model
- Plot log(y) vs. x, since exponential growth's constant percent change becomes linear on a log scale.
- Linearizing a power model
- Plot log(y) vs. log(x), since power functions have a constant ratio between log(y) and log(x).
- Checking a transformation's success
- Examine the residual plot of the transformed data — it should show random scatter with no pattern.
- Back-transforming
- Reversing the transformation (e.g., exponentiating a log-based prediction) to express a predicted value in original units.
Try an AP-style question
Data appear to follow y = a · bˣ. Which transformation should make them linear?
- Plot y² against x
- Plot log(y) against x
- Plot y against log(x)
- Plot 1/y against 1/x
Show the answer
B. log y = log a + x log b.
Practice 8 AP-style questions with instant explanations, flashcards and spaced review.
Study 5.9 free in APrep