Why Ratios Matter After a Log Transformation
When a predictor is transformed with a logarithm, a difference in the transformed values corresponds to a ratio of the original values. This is the key to interpreting a fitted effect: moving from 20 to 40 has the same log-scale change as moving from 100 to 200, because both changes double the predictor. By contrast, adding 20 to the predictor does not have a fixed effect on the log scale.
Suppose a model includes \(\ln(x)\), where \(x\) is a positive predictor. Its coefficient describes how the model’s linear predictor changes when \(x\) changes by a specified ratio, with other terms held fixed. It does not describe a fixed effect for every one-unit increase in \(x\).
From a Change in \(x\) to a Change in the Linear Predictor
Consider a model with linear predictor \(\eta=\alpha+\beta\ln(x)\), where \(\alpha\) represents the intercept and any other fixed contributions, \(\beta\) is the coefficient of the logged predictor, and \(x>0\). The two values of the linear predictor at \(x_1\) and \(x_2\) are \(\eta_1=\alpha+\beta\ln(x_1)\) and \(\eta_2=\alpha+\beta\ln(x_2)\). Subtracting them cancels the unchanged terms:
The last equality follows from the logarithm rule \(\ln(a)-\ln(b)=\ln(a/b)\) for positive \(a\) and \(b\). This derivation explains why the ratio is central: once the model contains \(\ln(x)\), subtracting the predictor’s two transformed values reduces to the logarithm of the ratio of the original values.
If \(x_2=cx_1\) for some positive multiplier \(c\), then the change is \(\beta\ln(c)\), regardless of the starting value \(x_1\). Thus, doubling \(x\) has the same effect on the linear predictor whether \(x\) doubles from 10 to 20 or from 500 to 1,000. If \(\beta>0\), increases in \(x\) increase the linear predictor; if \(\beta<0\), they decrease it. A ratio below 1 represents a decrease in \(x\), so its logarithm is negative.
Worked Example: A Doubling and a 25% Increase
A hypothetical risk score has linear predictor \(\eta=2+8\ln(x)\), with \(x>0\). Find the change in \(\eta\) when \(x\) increases from 10 to 20, and when it increases from 20 to 25. Explain why the two changes are different.
Method. Use the ratio formula \(\Delta\eta=8\ln(x_2/x_1)\). The intercept cancels, so it does not need to be evaluated.
From 10 to 20. The ratio is \(20/10=2\). Therefore,
Rounded to two decimal places, the linear predictor increases by 5.55.
From 20 to 25. The ratio is \(25/20=1.25\). Therefore,
Rounded to two decimal places, the linear predictor increases by 1.79. The first change doubles \(x\), while the second increases \(x\) by 25%; their ratios differ, so their log changes differ. This method avoids the common mistake of applying the doubling effect to every increase in \(x\).
Check. Both ratios exceed 1 and the coefficient is positive, so both changes must be positive. The 25% increase is a smaller multiplicative change than a doubling, and its calculated effect is smaller.
Equal Ratios, Unequal Raw Increases
The ratio rule can also be written in terms of a proportional change. If \(x_2=(1+r)x_1\), then \(r\) is the relative increase as a decimal, and the linear predictor changes by \(\beta\ln(1+r)\). For a decrease of proportion \(q\), the new value is \((1-q)x_1\), so the change is \(\beta\ln(1-q)\), provided \(0\leq q<1\).
For a small relative increase \(r\), \(\ln(1+r)\) is approximately \(r\). This approximation can help with a rough mental check, but it is not exact and becomes less reliable as the change grows. For example, a 10% increase has log change \(\ln(1.10)\), not exactly 0.10.
Equal raw increases can have unequal effects because their ratios depend on their starting values. An increase of 10 from 50 to 60 is a 20% increase, whereas an increase of 10 from 100 to 110 is a 10% increase. The logarithmic changes therefore differ, despite the same raw increase.
Worked Example: The Same Raw Increase at Two Starting Values
A model’s linear predictor contains \(4\ln(x)\). Compare the change in the linear predictor when \(x\) increases by 10 from 50 to 60 with the change when it increases by 10 from 100 to 110. Report each change to six decimal places.
Method. Calculate the ratio for each transition separately and apply \(\Delta\eta=4\ln(x_2/x_1)\). The raw increase alone is not enough to determine the change.
From 50 to 60. The ratio is \(60/50=1.2\), so
Rounded to six decimal places, the change is 0.729286.
From 100 to 110. The ratio is \(110/100=1.1\), so
Rounded to six decimal places, the change is 0.381241. The second change is smaller because the same increase of 10 is a smaller proportion of its starting value.
Check. The first ratio, 1.2, is greater than the second ratio, 1.1. Since the logarithm increases as its positive input increases, the first log-scale change—and thus the first change in \(\eta\) for a positive coefficient—is greater.
Interpreting the Coefficient in Context
For a model containing \(\beta\ln(x)\), \(\beta\) is the change in the linear predictor for a one-unit increase in \(\ln(x)\). Such a one-unit increase means multiplying \(x\) by \(e\), because \(\ln(ex)=\ln(x)+1\). This is mathematically valid, though often a doubling or a percentage change is more interpretable in a report.
For a doubling, use \(\Delta\eta=\beta\ln(2)\), not \(\beta\). For a 10% increase, use \(\Delta\eta=\beta\ln(1.10)\). These are changes in the linear predictor. Their meaning on the outcome scale depends on the rest of the model. If the model uses an identity link, a change in \(\eta\) is a change in the fitted mean on that scale. With a different link, an additional conversion is needed. A coefficient on a logged predictor alone does not justify saying that the outcome changes by \(\beta\) percent.
A change of measurement units does not change the ratio between two observations, as long as the same positive conversion factor is applied to both. For example, converting a positive measurement from dollars to thousands of dollars multiplies each value by the same constant. The difference between their log values is unchanged, because the constant cancels when the logs are subtracted. In a model refitted with the new units, the intercept may change, but the coefficient on \(\ln(x)\) and the fitted differences associated with the ratios remain the same.
Worked Example: Converting a Fitted Difference to a Dollar Amount
A hypothetical model for a score, measured in points, has linear predictor \(\eta=15+30\ln(x)\), where \(x\) is an index measured in dollars. Find the change in \(\eta\) as \(x\) rises from $1,000 to $1,500. Report the result to the nearest cent.
Method. Compare the two values using their ratio, \(1{,}500/1{,}000=1.5\). The fact that \(x\) is measured in dollars does not change this ratio.
The linear predictor increases by 12.16 points, rounded to the nearest cent (two decimal places). This is a score-scale difference in \(\eta\); interpreting it as a difference in the fitted outcome requires knowing the model’s link.
Check. The ratio is 1.5, so the predictor has increased by 50%. A positive coefficient therefore gives a positive linear-predictor change, consistent with the result.
Domain, Sign, and Common Exam Traps
The natural logarithm is defined for positive real inputs, so the model term \(\ln(x)\) requires \(x>0\). A zero or negative value cannot be inserted directly into this term. A different transformation may be appropriate in some settings, but it changes the interpretation; do not silently substitute a value or use a ratio formula outside its valid domain.
Several errors are easy to make under time pressure:
- Using the raw difference. Replacing \(\ln(x_2)-\ln(x_1)\) by \(x_2-x_1\) ignores the transformation. Use \(\ln(x_2/x_1)\).
- Using the ratio upside down. For a change from \(x_1\) to \(x_2\), the ratio is \(x_2/x_1\). Reversing it reverses the sign of the change.
- Applying the same effect to every one-unit increase. A fixed raw increase does not represent a fixed ratio. Check the starting and ending values.
- Calling the coefficient a percent effect on the outcome. The coefficient directly describes a change in the linear predictor per unit of \(\ln(x)\). The outcome-scale interpretation depends on the model.
For example, a common wrong calculation for a change from 40 to 60 in a predictor with coefficient 7 is \(7\ln(60-40)=7\ln(20)\). That incorrectly takes the logarithm of the raw difference. The correction uses the ratio:
This correction follows directly from subtracting the two logged predictor values. The ratio is greater than 1 and the coefficient is positive, so the change must be positive; the wrong calculation does not represent the model’s change between these observations.
Check Your Understanding
For each question, calculate the change in the linear predictor using the ratio of the final predictor value to the initial value. Round numerical changes to four decimal places unless otherwise stated.
- A model contains \(7\ln(x)\). Find the change in its linear predictor when \(x\) rises from 40 to 60. (Answer: \(7\ln(1.5)=2.8383\), an increase.)
- A model contains \(-0.6\ln(x)\). Find the change when \(x\) rises from 80 to 100. (Answer: \(-0.6\ln(1.25)=-0.1339\), a decrease.)
- A model contains \(2.5\ln(x)\). Find the change when \(x\) rises from 20 to 30. (Answer: \(2.5\ln(1.5)=1.0137\), an increase.)
- A model contains \(4\ln(x)\). Compare changes when \(x\) rises from 40 to 50 and from 90 to 100. (Answer: \(4\ln(1.25)=0.8926\) for 40 to 50; \(4\ln(100/90)=0.4214\) for 90 to 100. The equal raw increases do not give equal effects.)
- A model contains \(0.8\ln(x)\). Find the change when \(x\) falls from 250 to 200. (Answer: \(0.8\ln(0.8)=-0.1785\), a decrease.)