Logarithmic Regression — Definition, Formula & Examples
Logarithmic regression is a way to fit a curve to data that changes quickly at first and then levels off. You replace x with ln x and fit a straight line to the transformed data.
Logarithmic regression is the least-squares fit of the model for . It is equivalent to the least-squares regression line of on the transformed explanatory variable . The constants and minimize .
Key Formula
Where:
- = predicted value of the response variable
- = predicted y when x = 1, because ln 1 = 0
- = change in predicted y for each 1-unit increase in ln x
- = explanatory variable (must be positive)
- = natural logarithm of x
How It Works
First, check that the scatterplot shows a curve that is steep on the left and flattens out as x grows. Next, create a new variable (every x-value must be positive). Then run ordinary least-squares regression of on . Calculators such as the TI-84 do this directly with LnReg. If the residual plot against shows no pattern, the model fits well. To interpret the slope, note that doubling x always adds to the predicted y, wherever you start.
Worked Example
Problem: A teacher fits a logarithmic regression to hours studied (x) and test score (y). The model is . A student studied 4 hours and scored 66. Find the predicted score and the residual.
Step 1: Take the natural log of x = 4.
Step 2: Substitute into the model to get the predicted score.
Step 3: Find the residual as actual minus predicted.
Answer: The predicted score is about 63.86. The residual is about 2.14, so the student scored 2.14 points higher than the model predicts.
Why It Matters
On the AP Statistics exam, you are expected to straighten curved data by transforming a variable and then judge the fit with a residual plot. Logarithmic models describe diminishing returns, such as learning curves, how crop yield responds to fertilizer, and how perceived loudness grows with sound intensity.
Common Mistakes
Mistake: Interpreting b as the change in predicted y when x increases by 1.
Correction: The slope b is the change in predicted y when ln x increases by 1. That happens when x is multiplied by e (about 2.718). It does not happen when x goes up by 1. A clearer statement is that doubling x adds about 0.693b to the prediction.
