Linearizing
Transformations
Learn how to apply logarithmic, power, and reciprocal transformations to turn curved relationships into straight lines for better regression analysis.
Why Linearize Data?
Linear regression is one of the most powerful tools in statistics, but it only works well when the relationship between \(x\) and \(y\) is approximately linear. Many real-world relationships are curved: population growth is exponential, planetary orbits follow power laws, and chemical decay is logarithmic.
Recognizing a Curved Pattern
What Is a Transformation?
A transformation replaces one variable with a function of that variable. Instead of plotting \(y\) vs \(x\), we plot a new variable such as \(\ln(y)\) vs \(x\), or \(y\) vs \(\sqrt{x}\). If the right transformation is chosen, the new scatterplot will appear linear.
Three Key Models and Their Transforms
| Model | Equation | Transformation | Linear Form |
|---|---|---|---|
| Exponential | \(y = ab^x\) | Take \(\ln(y)\) | \(\ln(y) = \ln(a) + x\ln(b)\) |
| Power | \(y = ax^p\) | Take \(\ln\) of both | \(\ln(y) = \ln(a) + p\ln(x)\) |
| Logarithmic | \(y = a + b\ln(x)\) | Take \(\ln(x)\) | \(y = a + b\ln(x)\) |
Exponential: \(\ln(y)\) vs \(x\)
If the original data follows \(y = ab^x\), taking the natural log of both sides gives:
Power: \(\ln(y)\) vs \(\ln(x)\)
If the data follows \(y = ax^p\), taking the natural log of both variables gives:
Exponential vs Power: Which Transform?
Step-by-Step Linearization
Example 1: Bacterial Growth
A biologist counts bacteria every hour. The data is:
| Hours (\(x\)) | 0 | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|---|
| Count (\(y\)) | 50 | 120 | 280 | 700 | 1650 | 4000 |
| \(\ln(y)\) | 3.91 | 4.79 | 5.63 | 6.55 | 7.41 | 8.29 |
Example 1: Transformed Plot
The Back-Transform Step
After fitting a regression on transformed data, you must undo the transformation to make predictions in the original units. This is called back-transforming.
Example 2: Planet Orbital Data
Kepler's third law relates a planet's distance from the sun (\(x\), in AU) to its orbital period (\(y\), in Earth years). The relationship is a power model.
| Planet | Distance (AU) | Period (yr) | \(\ln(x)\) | \(\ln(y)\) |
|---|---|---|---|---|
| Mercury | 0.39 | 0.24 | -0.94 | -1.43 |
| Venus | 0.72 | 0.62 | -0.33 | -0.48 |
| Earth | 1.00 | 1.00 | 0.00 | 0.00 |
| Mars | 1.52 | 1.88 | 0.42 | 0.63 |
| Jupiter | 5.20 | 11.86 | 1.65 | 2.47 |
Example 2: \(\ln(y)\) vs \(\ln(x)\) Plot
Checking with Residual Plots
A good transformation produces a residual plot with no discernible pattern. If the residuals still curve, the transformation was not the right one.
Common Mistakes
Summary of Transformations
| If the Original Pattern Is... | Try This Plot | Model Form | Back-Transform |
|---|---|---|---|
| Exponential growth/decay | \(\ln(y)\) vs \(x\) | \(y = ab^x\) | \(\hat{y} = e^{a+bx}\) |
| Power relationship | \(\ln(y)\) vs \(\ln(x)\) | \(y = ax^p\) | \(\hat{y} = e^a \cdot x^b\) |
| Logarithmic growth | \(y\) vs \(\ln(x)\) | \(y = a + b\ln(x)\) | None needed |
Question 1 of 5
If a scatterplot of \(\ln(y)\) vs \(x\) appears linear, which model best describes the original data?
Question 2 of 5
A regression on transformed data yields \(\widehat{\ln(y)} = 2.1 + 0.45x\). What is the predicted value of \(y\) when \(x = 4\)?
Question 3 of 5
To linearize a power model \(y = ax^p\), you should plot:
Question 4 of 5
After applying a \(\ln(y)\) transformation and fitting a regression, the residual plot of the transformed data shows a clear U-shaped pattern. What should you conclude?
Question 5 of 5
A regression on \(\ln(y)\) vs \(\ln(x)\) produces the equation \(\widehat{\ln(y)} = 1.2 + 0.75\ln(x)\). Which equation describes the original relationship?