Tutorials › Regression Analysis (Undergraduate) › Checking Predictions After Unit Conversion

Units, Scaling, and Centering · Tutorial 150 of 991

Checking Predictions After Unit Conversion

Learn to verify that unit conversions change the numerical values of predictors and coefficients without changing fitted outcomes for the same records.

Intermediate 9 min read

What You'll Learn

  • Check predictions before and after converting a predictor’s units.
  • Update a slope according to the predictor’s unit conversion.
  • Verify predictions in a multiple regression model when one predictor changes units.
  • Track units through calculations involving both predictor and outcome conversions.
  • Identify common mistakes that create mismatched predictions.

Why Check Predictions After a Unit Conversion?

A regression equation depends on how its variables are measured. A slope stated as points per minute will have a different numerical value from the same slope stated as points per hour. That change in the coefficient does not mean the relationship has changed. If the predictor value and its coefficient are converted consistently, the fitted outcome for a record should remain the same.

This is useful when translating a model for a different audience, checking a hand calculation, or entering values in software that uses different units. The central check is direct: calculate the fitted value using the original units, convert the predictor and coefficient, then calculate it again. The two fitted values should agree, apart from any rounding.

The Prediction Equation and Unit Matching

For a regression model with one predictor, write the fitted-value equation as \(\hat{y}=b_0+b_1x\). Here \(\hat{y}\) is the predicted outcome, \(x\) is the predictor value, \(b_0\) is the intercept, and \(b_1\) is the slope. In a multiple regression model, a fitted value may have the form \(\hat{y}=b_0+b_1x_1+b_2x_2\). Each coefficient multiplies the predictor represented by its matching term.

A fitted value is calculated from a model and a specified predictor profile. It is not necessarily equal to the observed outcome for that record. When checking predictions after a unit conversion, keep the model and the underlying record fixed; only the numerical representation of a variable changes.

Key idea: A predictor conversion changes the predictor’s numerical value and the slope’s numerical value in opposite, compensating ways. If the intercept and all other terms are handled consistently, the fitted value for the same record is unchanged.

Suppose a time predictor is measured in minutes and is then expressed in hours. Since \(x_{\text{hours}}=x_{\text{minutes}}/60\), the equivalent numerical input in minutes is \(x_{\text{minutes}}=60x_{\text{hours}}\). A slope measured in outcome units per minute must therefore be represented as 60 times as large when it is expressed in outcome units per hour. The intercept is unchanged because the predictor’s units have not changed the model’s prediction at \(x=0\).

$$ b_0+b_{\text{minute}}x_{\text{minutes}} = b_0+(60b_{\text{minute}})x_{\text{hours}} $$

This equality is the basic arithmetic check. It does not require statistical assumptions about errors: it follows from rewriting the same predictor value in another unit. For this check to apply, the conversion must be exact, the same records and model terms must be used, and the coefficient must correspond to the converted predictor. If the outcome is also converted, its fitted values and coefficients must be expressed in the new outcome unit as well.

Worked Checks in Single-Predictor Models

Worked Example: Converting Minutes to Hours

Suppose a hypothetical model predicts a task score from time spent on a practice activity. Its fitted equation is \(\hat{y}=12+0.8x_{\text{minutes}}\), where the score is in points and time is in minutes. Check the prediction for a person who practiced for 75 minutes after rewriting the model using hours.

Original units. Substitute 75 minutes into the original equation:

$$ \hat{y}=12+0.8(75)=12+60=72\text{ points}. $$

Convert the predictor and slope. Seventy-five minutes is \(75/60=1.25\) hours. The original slope is 0.8 points per minute, so in points per hour its numerical value is \(0.8(60)=48\). The equivalent equation is \(\hat{y}=12+48x_{\text{hours}}\).

Check the converted prediction.

$$ \hat{y}=12+48(1.25)=12+60=72\text{ points}. $$

Both equations give a fitted score of 72 points for the same practice time. The slope changed from 0.8 points per minute to 48 points per hour because one hour contains 60 minutes; the predicted score did not change.

Worked Example: Checking More Than One Record

Consider the hypothetical fitted equation \(\hat{y}=5+1.2x_{\text{minutes}}\), where \(y\) is a predicted waiting time in seconds and \(x\) is a duration measured in minutes. Convert the predictor to hours and verify predictions for durations of 10 and 25 minutes.

The conversion is \(x_{\text{hours}}=x_{\text{minutes}}/60\), so the equivalent slope is \(1.2(60)=72\) seconds per hour. The converted equation is \(\hat{y}=5+72x_{\text{hours}}\).

For 10 minutes, the original prediction is \(5+1.2(10)=5+12=17\) seconds. The converted predictor is \(10/60=1/6\) hour, giving \(5+72(1/6)=5+12=17\) seconds.

For 25 minutes, the original prediction is \(5+1.2(25)=5+30=35\) seconds. The converted predictor is \(25/60=5/12\) hour, giving \(5+72(5/12)=5+30=35\) seconds.

The match for two records is a useful safeguard: a conversion error can sometimes be obscured by a particular value, but it will generally show up when checked at another predictor value.

Checking a Converted Predictor in Multiple Regression

In a multiple regression equation, convert only the predictor whose units are changing, and update the coefficient attached to that predictor. Leave the other predictor values and coefficients unchanged if their units and definitions have not changed. The following example checks this term by term.

Worked Example: Converting One Predictor in a Multiple Regression

Suppose a hypothetical model predicts a course score in points from study time in hours and commute time in minutes: \(\hat{y}=40+2.5x_{\text{study}}-0.03z_{\text{minutes}}\). Check the fitted score for a learner who studies for 5 hours and has a 40-minute commute after converting commute time to hours.

Original units. Substitute the profile into the equation:

$$ \hat{y}=40+2.5(5)-0.03(40) =40+12.5-1.2 =51.3\text{ points}. $$

Convert the commute term. Forty minutes is \(40/60=2/3\) hour. For a general commute duration, \(z_{\text{minutes}}=60z_{\text{hours}}\). Thus the commute contribution becomes \(-0.03(60z_{\text{hours}})=-1.8z_{\text{hours}}\). The equivalent equation is \(\hat{y}=40+2.5x_{\text{study}}-1.8z_{\text{hours}}\).

Check the converted prediction.

$$ \hat{y}=40+2.5(5)-1.8\left(\frac{2}{3}\right) =40+12.5-1.2 =51.3\text{ points}. $$

The study-time term remains \(2.5(5)=12.5\) points in both calculations. The commute-time coefficient changes from \(-0.03\) points per minute to \(-1.8\) points per hour, while its contribution to this particular fitted value remains \(-1.2\) points. The resulting fitted score is unchanged.

When the Outcome Unit Also Changes

A further check may involve expressing the outcome in a different unit as well as converting a predictor. In that case, predictions should agree after converting them to the same outcome unit. It is not appropriate to compare a prediction in grams directly with one in kilograms; first put both on a common scale.

Worked Example: Comparing Predictions in Grams and Kilograms

A hypothetical fitted equation predicts an object’s mass in grams from its height in centimeters: \(\hat{y}_{\text{grams}}=120+3.2x_{\text{centimeters}}\). Check the prediction for a height of 165 centimeters using an equivalent equation with height in meters and mass in kilograms.

Original equation. Since 165 centimeters is the given value,

$$ \hat{y}_{\text{grams}}=120+3.2(165) =120+528 =648\text{ g}. $$

Convert the predictors and outcome. The height is \(165/100=1.65\) meters. Since one meter contains 100 centimeters, the slope becomes \(3.2(100)=320\) grams per meter. Expressing the outcome in kilograms divides the intercept and slope by 1,000, giving the equivalent equation \(\hat{y}_{\text{kg}}=0.120+0.320x_{\text{meters}}\).

Check in the converted units.

$$ \hat{y}_{\text{kg}}=0.120+0.320(1.65) =0.120+0.528 =0.648\text{ kg}. $$

Because \(0.648\) kilograms equals \(648\) grams, the predictions agree. Comparing the numerical values 648 and 0.648 without noting their different units would falsely suggest a discrepancy.

A Reliable Checking Routine

A consistent sequence makes unit-conversion checks easier, especially when a model has several predictors. Keep the arithmetic tied to the units written beside each value.

1
Write the original prediction equation.
Record the coefficient, predictor, and unit for every term that enters the fitted value.
2
Convert the record’s predictor value.
Use the unit relationship to express the same physical or measured quantity in the new unit.
3
Update the matching coefficient.
Use the coefficient appropriate to the new predictor unit; do not alter unrelated terms.
4
Calculate both fitted values.
Substitute into each equation carefully and compare results in the same outcome unit.

When decimal conversion factors create slightly different displayed results, retain more digits during the calculations and round only at the end. Agreement should be judged at a precision justified by the reported coefficients and inputs.

Common Mistakes and Why the Check Matters

  • Changing the predictor value but not the slope. A value in hours cannot be multiplied by a coefficient in points per minute. Convert the coefficient to points per hour as well.
  • Applying the conversion in the wrong direction. If minutes are replaced by hours, the numerical predictor value becomes smaller by a factor of 60, so the slope’s numerical value becomes larger by a factor of 60. Check by substituting the unit identity, such as \(x_{\text{minutes}}=60x_{\text{hours}}\).
  • Changing every coefficient when only one predictor changed units. In an additive model, update the coefficient paired with the converted predictor. Unchanged predictors retain their values and coefficients.
  • Comparing predictions in different outcome units. A value in grams and a value in kilograms are not numerically comparable until expressed in the same unit.
  • Concluding that the fitted relationship changed. A different numerical slope can describe the same fitted relationship when the predictor unit changes. The fitted predictions for corresponding predictor values provide the direct check.

These checks matter because a unit conversion should be a change of representation, not a change to what was measured or to the model’s fitted outcomes. If corresponding predictions disagree, inspect the conversion factor, the coefficient paired with the predictor, the sign of each term, and the outcome units before drawing any conclusion.

Check Your Understanding

Use the prediction equation and units in each question to decide what should change and verify the arithmetic.

  1. A model is \(\hat{y}=7+0.5x_{\text{minutes}}\). Rewrite it using \(x_{\text{hours}}\), then check the prediction for 30 minutes.
  2. In \(\hat{y}=20+4a-0.2b_{\text{minutes}}\), only \(b\) is converted from minutes to hours. Which coefficient changes, and what is its new value?
  3. A prediction is 2.4 kilograms. What is the corresponding value in grams, and why should it not be compared as the same numerical value?
  4. Explain why replacing a predictor value in centimeters with its value in meters, while keeping a slope in outcome units per centimeter, gives an incorrect fitted value.
  5. For any model with an intercept, why does changing the unit of one predictor not by itself require changing the intercept?