Why Transform a Predictor?
A straight-line regression assumes that the conditional mean response changes at a constant rate for each one-unit increase in a predictor. That can be too restrictive: the response may change quickly at small predictor values and more slowly at larger values, or it may approach a limiting level. Transforming the predictor allows a curved relationship with the original predictor while retaining a model that is linear in its coefficients.
This tutorial considers three forms: a logarithmic predictor, a square-root predictor, and a reciprocal predictor. In each case, the response remains on its original scale. That differs from a log-response model, in which it is the response that is transformed.
For interpreting the mean curve, assume \(E[\varepsilon\mid X=x]=0\) in the model \(Y=\beta_0+\beta_1g(X)+\varepsilon\). This condition makes the stated curve the conditional mean. Additional assumptions about errors, such as constant variance or independence, matter for particular inference procedures, but are not needed to differentiate the mean curve. The usual domains are \(x>0\) for \(\ln x\), \(x\geq 0\) for \(\sqrt{x}\), and \(x\ne 0\) for \(1/x\). In many applications the reciprocal predictor is restricted to \(x>0\).
Three Transformations and Their Marginal Effects
A marginal effect is the derivative of the conditional mean with respect to the original predictor. It describes the approximate response change for a small increase in \(x\) near a particular value. It is not necessarily the actual change over a large interval.
The sign of the derivative determines whether the fitted mean rises or falls locally. The coefficient's sign alone is not enough for the reciprocal model: because the derivative includes a minus sign, a positive reciprocal coefficient gives a decreasing curve. The log and square-root models have the same derivative sign as \(\beta_1\) on their usual positive domains.
| Predictor form | Effect of a one-unit increase in transformed predictor | Typical curve on x > 0 |
|---|---|---|
| \(\ln x\) | A one-unit increase in \(\ln x\) multiplies \(x\) by \(e\) | Marginal effect has magnitude \(|\beta_1|/x\) |
| \(\sqrt{x}\) | A one-unit increase in \(\sqrt{x}\) changes the response by \(\beta_1\) | Marginal effect has magnitude \(|\beta_1|/(2\sqrt{x})\) |
| \(1/x\) | A one-unit increase in \(1/x\) changes the response by \(\beta_1\) | Curve approaches \(\beta_0\) as \(x\) grows |
The transformed scale gives an exact coefficient interpretation. For example, in a logarithmic model, multiplying \(x\) by \(c>0\) changes the mean by \(\beta_1\ln(c)\), because \(\ln(cx)-\ln(x)=\ln(c)\). Thus the effect of doubling \(x\) is \(\beta_1\ln 2\), regardless of the starting value. For a square-root or reciprocal model, the corresponding finite change is found by subtracting the transformed predictor values at the two endpoints.
Why the Derivative Formulas Hold
Each marginal-effect formula follows by differentiating the mean curve with respect to the original predictor. The coefficient \(\beta_1\) is constant, so it multiplies the derivative of the transformation. Applying the chain rule gives the log and square-root results; differentiating \(x^{-1}\) gives the reciprocal result.
\(\frac{d}{dx}\ln x=1/x\), \(\frac{d}{dx}\sqrt{x}=1/(2\sqrt{x})\) for \(x>0\), and \(\frac{d}{dx}x^{-1}=-x^{-2}\).
For \(\mu(x)=\beta_0+\beta_1g(x)\), the intercept differentiates to zero and \(\frac{d\mu}{dx}=\beta_1\frac{dg(x)}{dx}\).
Substitute that value into the derivative. The result is the instantaneous rate of change in response units per predictor unit at that point.
This derivation also explains why the coefficient is not generally the raw-unit slope. For instance, in a log-predictor model, a one-unit increase in \(x\) changes \(\ln x\) by an amount that depends on the starting value of \(x\). The derivative captures this changing rate.
Worked Example: Interpreting a Logarithmic Predictor
Suppose a hypothetical model predicts annual servicing cost \(Y\), measured in thousands of dollars, from equipment age \(x\), measured in years: \(\widehat{\mu}(x)=12+3\ln x\), for \(x>0\). Calculate fitted means at ages 1, 4, and 9; compare the changes from 1 to 2 years and from 4 to 5 years; and find the marginal effect at ages 1 and 4.
Method. Evaluate the fitted mean at each age, use endpoint subtraction for finite changes, and differentiate for local effects. The coefficient 3 is measured in thousands of dollars per one-unit increase in \(\ln x\).
At \(x=1\), \(\ln 1=0\), so \(\widehat{\mu}(1)=12+3(0)=12.0000\) thousand dollars. At \(x=4\), \(\ln 4=1.3863\), so \(\widehat{\mu}(4)=12+3(1.3863)=16.1589\) thousand dollars. At \(x=9\), \(\ln 9=2.1972\), so \(\widehat{\mu}(9)=12+3(2.1972)=18.5917\) thousand dollars.
The exact change from age 1 to age 2 is \(3(\ln 2-\ln 1)=3(0.6931)=2.0794\) thousand dollars. From age 4 to age 5 it is \(3(\ln 5-\ln 4)=3\ln(1.25)=3(0.2231)=0.6694\) thousand dollars. The same one-year increase has a smaller fitted effect at the higher starting age.
The marginal effect is \(3/x\) thousand dollars per year. It is \(3/1=3.0000\) at age 1 and \(3/4=0.7500\) at age 4. These local rates differ from the finite one-year changes because a derivative is an instantaneous rate.
Check. The calculated means rise with age because the coefficient is positive and \(\ln x\) increases for \(x>0\). The smaller one-year change at age 4 agrees with the smaller derivative there. A common mistake would be to claim each extra year adds 3 thousand dollars; that incorrectly treats the coefficient as a raw-age slope.
Worked Example: Interpreting a Square-Root Predictor
A hypothetical model relates a nonnegative exposure measure \(x\) to a response \(Y\), measured in thousands of dollars: \(\widehat{\mu}(x)=8+2\sqrt{x}\). Calculate the fitted means at \(x=0,4,9,16\), the changes from 4 to 9 and from 9 to 16, and the marginal effects at 4 and 16.
Method. Substitute each predictor value into the square-root model, then differentiate for the local effects. Here \(x\geq 0\), while the derivative expression applies at \(x>0\).
At \(x=0\), \(\sqrt{0}=0\), so the fitted mean is \(8+2(0)=8\) thousand dollars. At \(x=4\), it is \(8+2(2)=12\) thousand dollars. At \(x=9\), it is \(8+2(3)=14\) thousand dollars. At \(x=16\), it is \(8+2(4)=16\) thousand dollars.
From 4 to 9, the fitted change is \(2(\sqrt{9}-\sqrt{4})=2(3-2)=2\) thousand dollars. From 9 to 16, it is \(2(\sqrt{16}-\sqrt{9})=2(4-3)=2\) thousand dollars. These intervals have different widths, so equal response changes do not imply a constant rate per unit of \(x\).
For \(x>0\), the marginal effect is \(2/(2\sqrt{x})=1/\sqrt{x}\) thousand dollars per unit of exposure. At \(x=4\), it is \(1/2=0.5000\); at \(x=16\), it is \(1/4=0.2500\). The derivative is not finite at \(x=0\), even though the fitted mean itself is defined there.
Check. The means increase because the coefficient is positive, and their marginal rate decreases as \(x\) grows. A common mistake is to apply the derivative formula at zero; it is undefined there, so a finite difference must be used when comparing the response at zero with a positive predictor value.
Worked Example: Interpreting a Reciprocal Predictor
Suppose a hypothetical model predicts a response \(Y\), measured in thousands of dollars, from a positive training duration \(x\), measured in hours: \(\widehat{\mu}(x)=10+24/x\), for \(x>0\). Calculate the fitted means at 2, 4, and 8 hours, the changes over 2-to-4 and 4-to-8 hours, and the marginal effects at 2 and 4 hours.
Method. Evaluate the reciprocal at each positive predictor value and differentiate. The coefficient 24 is the change in fitted response for a one-unit increase in \(1/x\), not for an extra hour of training.
At \(x=2\), \(\widehat{\mu}(2)=10+24/2=22\) thousand dollars. At \(x=4\), \(\widehat{\mu}(4)=10+24/4=16\) thousand dollars. At \(x=8\), \(\widehat{\mu}(8)=10+24/8=13\) thousand dollars.
From 2 to 4 hours, the change is \(16-22=-6\) thousand dollars. From 4 to 8 hours, it is \(13-16=-3\) thousand dollars. The fitted mean falls in both intervals, but the decline is smaller in the second interval.
The marginal effect is \(-24/x^2\) thousand dollars per hour. At \(x=2\), it is \(-24/4=-6.0000\); at \(x=4\), it is \(-24/16=-1.5000\). As \(x\) grows, the fitted mean approaches the horizontal limiting value 10 thousand dollars, since \(24/x\) approaches zero.
Check. The negative derivatives agree with the decreasing fitted means. A common mistake is to say a positive coefficient means the response rises with \(x\). Here the reciprocal transformation reverses the direction: the derivative has a minus sign.
Comparing Curves and Interpreting Results
These transformations encode different patterns in the response curve. With a positive coefficient, the logarithmic and square-root curves rise, but their marginal effects decline as \(x\) increases. With a positive reciprocal coefficient, the fitted mean falls toward \(\beta_0\) on the positive domain. A negative reciprocal coefficient instead gives an increasing curve that approaches \(\beta_0\) from below. In all three forms, the intercept is the fitted mean at transformed predictor value zero when that value is in the model's domain. For the log model, this corresponds to \(x=1\); for the square-root model, \(x=0\); and for the reciprocal model there is no finite \(x\) with \(1/x=0\).
Use finite differences when a question asks for the predicted change across an interval. Use a derivative when it asks for a local rate at a particular predictor value. Keep the units explicit: if \(Y\) is in thousands of dollars, a derivative is in thousands of dollars per predictor unit. Convert to dollars only if the question requests it.
A log predictor must be positive; a square-root predictor must be nonnegative; and the reciprocal is undefined at zero. Predictions should not be interpreted outside the domain or data range without considering whether the fitted relationship remains reasonable there. The transformation changes the shape of the mean relationship, but it does not by itself establish causation.
Being able to move between the transformed-scale coefficient and the response curve is aligned with the SOA Exam SRM (Statistics for Risk Modeling) syllabus. A reliable interpretation names the response units, predictor units, transformation, and whether the reported effect is finite or local.
Check Your Understanding
For each problem, state the requested effect in the response units shown.
- A model for response \(Y\), in thousands of dollars, is \(\widehat{\mu}(x)=40-5\ln x\), with \(x>0\). Find the fitted change as \(x\) increases from 1 to \(e^2\), and find the marginal effect at \(x=5\). (Answer: change \(=-10\) thousand dollars; marginal effect \(=-1\) thousand dollars per unit of \(x\))
- A model is \(\widehat{\mu}(x)=6+1.5\sqrt{x}\), for \(x\geq0\). Find the fitted change from \(x=9\) to \(x=25\), and the marginal effect at \(x=9\). (Answer: change \(=3\) response units; marginal effect \(=0.25\) response units per unit of \(x\))
- A model is \(\widehat{\mu}(x)=3+18/x\), for \(x>0\). Find the fitted change from \(x=3\) to \(x=6\), and the marginal effect at \(x=3\). (Answer: change \(=-3\) response units; marginal effect \(=-2\) response units per unit of \(x\))
- A model is \(\widehat{\mu}(x)=2+4\ln x\). Find the fitted change when \(x\) increases from 2 to 8. (Answer: \(4\ln 4\), approximately \(5.5452\) response units)
- A model is \(\widehat{\mu}(x)=25-30/x\), for \(x>0\). Find the fitted means at \(x=2\) and \(x=5\), their difference, and the marginal effect at \(x=5\). (Answer: fitted means \(10\) and \(19\); change \(=9\) response units; marginal effect \(=1.2\) response units per unit of \(x\))