Tutorials › VEE Mathematical Statistics › How Changes of Units Affect Regression Coefficients

VEE Mathematical Statistics · Least Squares Estimation · Tutorial 729 of 880

How Changes of Units Affect Regression Coefficients

Learn to update a fitted regression equation after shifting or rescaling either variable, and check that its predictions remain consistent.

Intermediate 10 min read

What You'll Learn

  • State the conditions needed for the coefficient transformation formulas.
  • Derive how predictor shifts and scale changes affect the fitted intercept and slope.
  • Convert a fitted equation when the response is shifted or rescaled.
  • Combine predictor and response transformations in one calculation.
  • Verify transformed fitted values and recognize common unit-conversion errors.

Why Units Change Coefficients

A least-squares regression equation depends on how its variables are recorded. If a predictor is measured in minutes rather than hours, the numerical slope changes even though the fitted predictions do not. If the response is recorded in hundreds of dollars rather than dollars, both its intercept and slope change scale. Shifting the origin of either variable can also change the intercept. Keeping these changes straight is important when comparing fitted equations or converting their predictions back to the original units.

The focus here is the ordinary least-squares line with an intercept. For observed pairs \((x_i,y_i)\), the fitted equation is \(\hat y=\hat\beta_0+\hat\beta_1x\). Assume there are at least two distinct predictor values, so the slope is identifiable. The coefficient formulas below describe what happens when the recorded variables are changed by shifts and nonzero scale factors.

Definition: An affine change of predictor and response units has the form \(z=a+bx\) and \(w=c+dy\), where \(a,b,c,d\) are constants and \(b\ne0\), \(d\ne0\). The nonzero scale factors make each transformation reversible. Write the least-squares equation for the transformed variables as \(\hat w=\hat\alpha_0+\hat\alpha_1z\).

A shift changes the point called zero; a scale change changes the size of one unit. The signs of \(b\) and \(d\) can be negative as well as positive: a negative scale factor reverses the direction in which that variable is recorded. It is useful to distinguish a transformed equation from an unchanged equation. The numerical coefficients and fitted response values may change, but corresponding predictions describe the same fitted relationship after converting units.

The Coefficient Transformation Rule

For the original fitted line \(\hat y=\hat\beta_0+\hat\beta_1x\), the least-squares coefficients after transforming both variables are

$$ \hat\alpha_1=\frac{d}{b}\hat\beta_1, \qquad \hat\alpha_0=c+d\hat\beta_0-\frac{da}{b}\hat\beta_1. $$

The slope is multiplied by the response scale factor and divided by the predictor scale factor. The transformed intercept also accounts for both shifts: it is the fitted transformed response at \(z=0\), which corresponds to \(x=-a/b\), not generally to \(x=0\).

Theorem: Under ordinary least squares with an intercept, if \(z_i=a+bx_i\) and \(w_i=c+dy_i\), where \(b\ne0\) and \(d\ne0\), then the transformed least-squares fitted value at \(z_i\) is \(c+d\hat y_i\). Its fitted coefficients are \(\hat\alpha_1=(d/b)\hat\beta_1\) and \(\hat\alpha_0=c+d\hat\beta_0-(da/b)\hat\beta_1\).

The corresponding fitted values are not necessarily numerically unchanged. If only the predictor is recoded, \(c=0\) and \(d=1\), so the fitted response values are unchanged. If the response is also transformed, each fitted value is shifted and scaled in exactly the same way as the response.

Why the Rule Holds

The key is that every candidate line in the transformed variables corresponds to exactly one candidate line in the original variables. Because \(z=a+bx\) and \(w=c+dy\) are reversible, changing coordinates does not offer least squares a different set of possible fitted lines. It only expresses those lines in different units.

1
Start with any candidate transformed line.
Let its prediction be \(A+Bz\). In original response units, this prediction is \((A+B(a+bx)-c)/d\).
2
Identify the corresponding original coefficients.
The original-scale prediction has intercept \((A+Ba-c)/d\) and slope \(Bb/d\). Since \(b,d\ne0\), this correspondence is reversible.
3
Compare the squared errors.
For each observation, \(w_i-(A+Bz_i)\) is \(d\) times the corresponding original-scale residual. Thus the transformed sum of squared errors is \(d^2\) times the original sum of squared errors.
4
Use the minimizing line.
Since \(d^2>0\), multiplying every candidate sum of squared errors by \(d^2\) does not change which line minimizes it. Substituting the original fitted coefficients gives the stated formulas and \(\hat w_i=c+d\hat y_i\).

In particular, shifting or rescaling the predictor does not change which response-scale line is selected: it only changes how that line is written. Rescaling the response multiplies all squared errors by the same positive factor, so it also preserves the minimizing line after conversion back to the original response scale.

Worked Examples

Worked Example: Converting a Slope from Meters to Centimeters

A hypothetical engineering analysis gives the fitted equation \(\hat y=3+2x\), where \(x\) is distance in meters and \(y\) is a measured response in its original units. Rewrite the equation using \(z\), the distance in centimeters, and find the fitted response at 250 centimeters.

Method. Only the predictor unit changes, so \(z=100x\). In the general rule, \(a=0\), \(b=100\), \(c=0\), and \(d=1\). The transformed slope is

$$ \hat\alpha_1=\frac{1}{100}(2)=0.02, \qquad \hat\alpha_0=0+1(3)-\frac{1(0)}{100}(2)=3. $$

Thus the equation in centimeters is \(\hat y=3+0.02z\). At 250 centimeters, the fitted value is

$$ \hat y=3+0.02(250)=3+5=8. $$

Check. Since \(250\) centimeters is \(2.5\) meters, the original equation gives \(3+2(2.5)=8\), the same fitted value. The method avoids treating the slope as \(2\) response units per centimeter, which would make the predicted change one hundred times too large.

Worked Example: Shifting and Reversing Both Variables

For a hypothetical data set, the original least-squares equation is \(\hat y=4.5+(17/14)x\). The variables are recoded as \(z=10+2x\) and \(w=100-3y\). Find the transformed fitted equation, then check its predictions at the observations \((x,y)=(1,5),(2,8),(4,9)\).

Method. Here \(a=10\), \(b=2\), \(c=100\), and \(d=-3\). The transformed slope is

$$ \hat\alpha_1=\frac{-3}{2}\left(\frac{17}{14}\right)=-\frac{51}{28}. $$

The transformed intercept is

$$ \hat\alpha_0=100-3\left(\frac{9}{2}\right) -\frac{(-3)(10)}{2}\left(\frac{17}{14}\right) =100-\frac{27}{2}+\frac{255}{14} =\frac{733}{7}. $$

Therefore, the transformed fitted equation is \(\hat w=733/7-(51/28)z\). To check the first observation, \(z=10+2(1)=12\) and \(w=100-3(5)=85\). The fitted transformed value is

$$ \hat w=\frac{733}{7}-\frac{51}{28}(12) =\frac{580}{7}\approx82.8571. $$

On the original scale, the fitted value at \(x=1\) is \(4.5+17/14=40/7\), and transforming it gives \(100-3(40/7)=580/7\), as required.

At \(x=2\), \(z=14\) and the original fitted value is \(4.5+34/14=97/14\). Its transformed value is \(100-3(97/14)=1109/14\). Substitution in the transformed line gives \(733/7-(51/28)(14)=1109/14\).

At \(x=4\), \(z=18\) and the original fitted value is \(4.5+68/14=131/14\). Its transformed value is \(100-3(131/14)=1007/14\). The transformed line gives \(733/7-(51/28)(18)=1007/14\).

Check. All three transformed predictions agree with the original fitted values after applying \(w=100-3y\). The negative response scale reverses the slope direction; ignoring that sign would give an incorrect slope.

Worked Example: Centering a Predictor and Reporting Response in Hundreds

A hypothetical portfolio study records predictor values \(x=2,3,4,5,6\) and response values \(y=750,850,1200,1550,1650\), where the response is in dollars. Re-express the predictor as \(z=x-4\) and the response as \(w=y/100\), in hundreds of dollars. Find the transformed least-squares line and verify the sum of squared errors changes as expected.

Method. First calculate the means: \(\bar x=(2+3+4+5+6)/5=4\) and \(\bar y=(750+850+1200+1550+1650)/5=1200\). The centered predictor deviations are \(-2,-1,0,1,2\), so

$$ S_{xx}=(-2)^2+(-1)^2+0^2+1^2+2^2=10. $$

The response deviations from 1200 are \(-450,-350,0,350,450\). Their products with the corresponding predictor deviations sum to

$$ S_{xy}=(-2)(-450)+(-1)(-350)+0(0)+1(350)+2(450)=2500. $$

Thus the original slope is \(2500/10=250\), and the original intercept is \(1200-250(4)=200\). The original fitted equation is \(\hat y=200+250x\).

For the recoding, \(z=x-4\) means \(a=-4\), \(b=1\); and \(w=y/100\) means \(c=0\), \(d=1/100\). Therefore,

$$ \hat\alpha_1=\frac{1}{100}(250)=2.5, \qquad \hat\alpha_0=\frac{1}{100}(200) -\frac{(1/100)(-4)}{1}(250)=2+10=12. $$

The new equation is \(\hat w=12+2.5z\). For example, at \(x=2\), \(z=-2\), so the transformed fitted value is \(12+2.5(-2)=7\) hundreds of dollars, or $700. The original line gives \(200+250(2)=$700.

For the error check, the original fitted values are \(700,950,1200,1450,1700\). The residuals are \(50,-100,0,100,-50\), so the original sum of squared errors is \(2500+10000+0+10000+2500=25000\) dollars squared. Since the response was divided by 100, its transformed sum of squared errors is \(25000/100^2=2.5\) hundreds-of-dollars squared. The transformed residuals are \(0.5,-1,0,1,-0.5\), whose squared values also sum to \(2.5\).

Check. The centered predictor leaves the slope unchanged, while converting dollars to hundreds divides both coefficients by 100 after centering. The fitted predictions and the squared-error scaling agree with the transformations.

Common Mistakes and Exam Traps

A frequent mistake is to apply a unit conversion to the slope in the same direction as the predictor conversion. If \(z=100x\), one unit of \(z\) is one hundredth of a unit of \(x\), so the slope per unit of \(z\) is the original slope divided by 100. More generally, the transformed slope is \((d/b)\hat\beta_1\), not \(bd\hat\beta_1\).

Another trap is to transform the slope but leave the intercept unchanged after shifting the predictor. For example, if \(z=x-4\), then \(x=z+4\). Substitution into \(\hat y=\hat\beta_0+\hat\beta_1x\) gives \(\hat y=(\hat\beta_0+4\hat\beta_1)+\hat\beta_1z\), so the intercept must change.

  • Check which direction the conversion goes. Write the new variable in terms of the old one, such as \(z=100x\), before transforming the coefficients.
  • Keep shifts in the intercept calculation. A predictor shift changes the value of the predictor represented by zero; it does not generally change the slope.
  • Track response units separately. Multiplying the response by \(d\) multiplies the slope by \(d\) and also affects the intercept.
  • Do not claim all fitted values stay numerically identical. They stay the same only when the response is unchanged. Otherwise, corresponding fitted values transform as \(c+d\hat y_i\).

These rules apply to an ordinary least-squares line with an intercept and reversible affine transformations. If the predictor has no variation, its slope cannot be identified from the data. If a scale factor is zero, the transformation is not reversible, so the coefficient rule does not apply. This unit-conversion reasoning is aligned with the SOA VEE Mathematical Statistics syllabus.

Check Your Understanding

For each problem, write down the variable transformation before changing the regression coefficients.

  1. A fitted line is \(\hat y=4+1.5x\). The predictor is changed to \(z=60x\), while the response stays unchanged. Find the new equation and its fitted value at \(z=120\). (Answer: \(\hat y=4+0.025z\); fitted value \(7\).)
  2. A fitted line is \(\hat y=3+4x\). Define \(z=x-5\) and \(w=2y+10\). Find the equation for predicting \(w\) from \(z\). (Answer: \(\hat w=56+8z\).)
  3. A fitted line is \(\hat y=7-0.5x\). Define \(z=20-2x\) and \(w=5-y\). Find the transformed intercept and slope. (Answer: \(\hat w=3-0.25z\).)
  4. A hypothetical fitted line predicts annual cost \(y\) in dollars from exposure \(x\) as \(\hat y=500+80x\). Let \(z=x-10\) and let \(w=y/1000\), measured in thousands of dollars. Find the transformed equation and the fitted cost at \(x=12\). (Answer: \(\hat w=1.3+0.08z\); at \(x=12\), fitted cost is $1,460, or \(1.46\) thousand dollars.)
Clinical Biostats