Tutorials › Regression Analysis (Undergraduate) › Converting a Predictor from One Unit to Another

Units, Scaling, and Centering · Tutorial 148 of 991

Converting a Predictor from One Unit to Another

See how to convert a simple regression equation when a predictor changes units, preserving its predictions while expressing the slope in the new units.

Intermediate 9 min read

What You'll Learn

  • Express a unit conversion as a relationship between the old and new predictor values.
  • Convert a regression slope using the scale factor between predictor units.
  • Explain why the intercept stays the same in a pure unit conversion.
  • Check that predictions are unchanged after converting dollars, days, and grams.
  • Distinguish a change in coefficient units from a change in the fitted relationship.
  • Identify common errors when converting a slope.

Why Predictor Units Change a Slope

A regression slope describes how the fitted outcome changes for a one-unit increase in the predictor. But a “one-unit” increase depends on how the predictor is measured. A slope expressed per dollar will have a different numerical value from the same slope expressed per thousand dollars. The fitted relationship need not change: only the numerical scale used to describe the predictor changes.

This tutorial considers a simple regression with an intercept and one quantitative predictor. The response remains in the same units throughout. The task is to express the predictor in a different unit while keeping the fitted outcomes identical.

Model: For observation \(i\), write the simple linear regression model as \(Y_i=\beta_0+\beta_1x_i+\varepsilon_i\), where \(Y_i\) is the response, \(x_i\) is the predictor, \(\beta_0\) is the intercept, \(\beta_1\) is the slope, and \(\varepsilon_i\) is the error. The model describes a linear mean response, with errors having mean zero; regression inference commonly also relies on independence and constant error variance, and exact small-sample inference may assume normally distributed errors. The unit-conversion result below is algebraic: it requires an exact conversion of the predictor and the same linear form, not those additional inference assumptions.

The fitted regression equation uses estimates of the model coefficients. We write it as \(\hat{y}=b_0+b_1x\), where \(\hat{y}\) is the fitted response, \(b_0\) is the fitted intercept, and \(b_1\) is the fitted slope. The intercept has response units; the slope has response units per predictor unit.

The Conversion Rule

Let \(x_{\text{old}}\) be the numerical predictor value in its original unit and \(x_{\text{new}}\) the numerical value in the new unit. Suppose the conversion can be written as \(x_{\text{new}}=q x_{\text{old}}\), where \(q\) is the number of new-unit values corresponding to one old-unit value. Then \(x_{\text{old}}=x_{\text{new}}/q\). Substituting this expression into the original fitted line gives the new equation.

$$ \hat{y}=b_{0,\text{old}}+b_{1,\text{old}}x_{\text{old}} =b_{0,\text{old}}+\frac{b_{1,\text{old}}}{q}x_{\text{new}} $$
Conversion rule: If \(x_{\text{new}}=q x_{\text{old}}\), then the equivalent fitted equation has \(b_{0,\text{new}}=b_{0,\text{old}}\) and \(b_{1,\text{new}}=b_{1,\text{old}}/q\). The response stays in the same units. Because a pure unit conversion maps zero to zero, the intercept is unchanged; the slope’s numerical value changes to match the new predictor unit.

For example, if the new unit is larger than the old unit, the numerical predictor values become smaller. The slope’s numerical value must then become larger by the corresponding factor: one new unit covers more of the original predictor scale. Conversely, if the new unit is smaller, the numerical predictor values become larger and the slope’s numerical value becomes smaller.

Worked Example: Dollars to Thousands of Dollars

Suppose a hypothetical fitted line predicts an annual service cost, in dollars, from a machine’s purchase price, in dollars:

$$ \widehat{\text{cost}}=120+0.08x_{\text{dollars}} $$

The slope is \(0.08\) dollars of fitted annual service cost per dollar of purchase price. Define \(x_{\text{thousands}}=x_{\text{dollars}}/1000\). Thus \(x_{\text{dollars}}=1000x_{\text{thousands}}\), so the conversion factor in the rule is \(q=1/1000=0.001\). Substitute:

$$ \widehat{\text{cost}} =120+0.08(1000x_{\text{thousands}}) =120+80x_{\text{thousands}}. $$

The converted slope is \(0.08/0.001=80\) dollars of fitted annual service cost per thousand dollars of purchase price. The intercept remains \(120\) dollars. For a purchase price of \(2500\) dollars, the original equation gives \(120+0.08(2500)=120+200=320\) dollars. In the new scale, the predictor is \(2500/1000=2.5\) thousand dollars, and the converted equation gives \(120+80(2.5)=120+200=320\) dollars. The fitted outcome is unchanged.

Worked Conversions in Both Directions

It helps to identify \(q\) from the actual conversion before changing the slope. In particular, converting days to hours and converting hours to days use reciprocal factors. The equation \(x_{\text{new}}=q x_{\text{old}}\) makes clear which factor applies.

Worked Example: Days to Hours

Consider a hypothetical fitted equation predicting a travel distance in kilometers from travel duration in days:

$$ \widehat{\text{distance}}=42+18x_{\text{days}}. $$

The slope is \(18\) kilometers per day. Since one day is 24 hours, the numerical duration in hours is \(x_{\text{hours}}=24x_{\text{days}}\). Here \(q=24\), so \(x_{\text{days}}=x_{\text{hours}}/24\). Substituting gives:

$$ \widehat{\text{distance}} =42+18\left(\frac{x_{\text{hours}}}{24}\right) =42+0.75x_{\text{hours}}. $$

The new slope is \(18/24=0.75\) kilometers per hour; the intercept remains \(42\) kilometers. For a duration of \(2.5\) days, \(x_{\text{hours}}=24(2.5)=60\) hours. The original equation predicts \(42+18(2.5)=42+45=87\) kilometers. The converted equation predicts \(42+0.75(60)=42+45=87\) kilometers. Both equations therefore give the same fitted distance.

Worked Example: Grams to Kilograms

Suppose a hypothetical fitted line predicts processing time in minutes from a material’s mass in grams:

$$ \widehat{\text{time}}=6+0.012x_{\text{grams}}. $$

Since \(x_{\text{kilograms}}=x_{\text{grams}}/1000\), we have \(x_{\text{grams}}=1000x_{\text{kilograms}}\). The conversion factor is \(q=0.001\). Therefore:

$$ \widehat{\text{time}} =6+0.012(1000x_{\text{kilograms}}) =6+12x_{\text{kilograms}}. $$

The slope changes from \(0.012\) minutes per gram to \(12\) minutes per kilogram, since \(0.012/0.001=12\). For \(750\) grams, the new predictor value is \(750/1000=0.75\) kilograms. The first equation gives \(6+0.012(750)=6+9=15\) minutes; the converted equation gives \(6+12(0.75)=6+9=15\) minutes. The response is still measured in minutes, and the fitted prediction is preserved.

Why the Fitted Relationship Is Preserved

The substitution above proves that each predictor value and its converted value produce exactly the same fitted response. The same idea explains why a least-squares fit is preserved if the model is refit using the converted predictor, provided the same observations are used and the model includes an intercept.

1
Convert every predictor value.
For each observation, set \(x_{\text{new},i}=q x_{\text{old},i}\), with \(q\) nonzero. This is a one-to-one conversion: each value on one scale corresponds to exactly one value on the other.
2
Translate the line’s coefficients.
For any old-scale line \(b_{0,\text{old}}+b_{1,\text{old}}x_{\text{old},i}\), choose \(b_{0,\text{new}}=b_{0,\text{old}}\) and \(b_{1,\text{new}}=b_{1,\text{old}}/q\). Its fitted value at each observation is identical.
3
Compare residual sums of squares.
Since every observation has the same fitted value under the translated coefficients, every residual \(y_i-\hat{y}_i\) is unchanged. Consequently, the sum of squared residuals is unchanged. Every candidate line on one scale has a matching line on the other, so the least-squares minimizing line also translates by this rule.

This justification concerns a pure change of predictor units: multiplying all predictor values by a fixed nonzero conversion factor. It does not change the observed responses, residuals, or predictions. The slope changes because its “per unit” part changes. No new fit is needed merely to report the same fitted relationship in the new predictor unit.

Common Mistakes and a Practical Check

  • Multiplying or dividing the slope without identifying the conversion direction. First write \(x_{\text{new}}=q x_{\text{old}}\), then divide the old slope by \(q\). This avoids reversing the factor.
  • Changing the intercept along with the slope. In a pure multiplicative unit conversion, zero on the old scale is zero on the new scale, so the intercept stays the same.
  • Forgetting the coefficient’s units. A slope of \(80\) dollars per thousand dollars is not \(80\) dollars per dollar. State both response and predictor units when interpreting it.
  • Thinking the changed slope means the relationship changed. Compare predictions at equivalent predictor values. If the units were converted correctly, the fitted responses match.

A reliable check is to choose one predictor value, convert it into the new unit, and calculate the fitted response with both equations. If the results differ, check whether the conversion factor was inverted or the slope was scaled in the wrong direction.

Key takeaway: Write the predictor conversion as \(x_{\text{new}}=q x_{\text{old}}\). Keep the intercept, divide the slope by \(q\), and retain the response’s original units. The equivalent equations then give identical fitted outcomes.

Check Your Understanding

Try these questions by writing the conversion relation before changing the coefficient.

  1. A fitted line has slope \(3.2\) response units per meter. The predictor is converted to centimeters, so \(x_{\text{cm}}=100x_{\text{m}}\). What is the new slope, including its units?
  2. A model predicts a response in dollars from a predictor measured in days. If the slope is \(48\) dollars per day, what is the slope in dollars per hour? State the conversion relation you use.
  3. When converting a predictor from dollars to thousands of dollars, why does the slope’s numerical value increase while the intercept stays the same?
  4. A converted equation predicts \(156\) units, while the original equation predicts \(154\) units for equivalent predictor values. Name two conversion or arithmetic checks to make.
  5. Does changing predictor units alone change the fitted response values? Explain using the relationship between the old and new predictor values.