Tutorials › VEE Mathematical Statistics › Changing Units of X and Y in Regression

VEE Mathematical Statistics · Simple Linear Regression Model · Tutorial 713 of 880

Changing Units of X and Y in Regression

Learn to convert regression coefficients correctly when measurement units or origins change, and identify which features of the model remain unchanged.

Intermediate 10 min read

What You'll Learn

  • Derive the transformed intercept and slope under affine changes of units
  • Convert regression equations when the predictor, response, or both are rescaled
  • Account for changes in measurement origins as well as scales
  • Track how errors, residuals, and error variance transform
  • Distinguish unit-dependent coefficients from invariant model features

Why Regression Coefficients Depend on Units

A regression slope is a rate of change measured in the units of the response per unit of the predictor. If a predictor is recorded in minutes rather than hours, its numerical slope changes even though the underlying relationship does not. Changing the response unit also changes the slope, and usually the intercept. Correctly converting these quantities is essential when interpreting a model or comparing results reported on different scales.

The same issue arises when a unit conversion changes the zero point, as with Celsius and Fahrenheit. A change of scale affects the numerical size of a coefficient; a change of origin can also affect the intercept. The algebra below handles both effects and identifies what is preserved.

Model: Suppose the conditional mean of a response \(Y\), given a predictor \(X\), is linear: $$ E[Y\mid X]=\beta_0+\beta_1X. $$ Equivalently, write \(Y=\beta_0+\beta_1X+\varepsilon\), where \(E[\varepsilon\mid X]=0\). For statements about constant error variance, assume \(\operatorname{Var}(\varepsilon\mid X)=\sigma^2\). These assumptions concern the original units; the transformation results below state how the model changes under new units.

The General Unit-Conversion Formula

Consider affine changes of measurement: \(X^*=a+bX\) and \(Y^*=c+dY\), where \(b\ne 0\) and \(d\ne 0\). The constants \(a\) and \(c\) allow the zero points to change; \(b\) and \(d\) change the scales. Solve the predictor conversion for \(X\), substitute it into the conditional mean, and then convert the response.

$$ X=\frac{X^*-a}{b},\qquad E[Y^*\mid X^*] =c+d\beta_0+\frac{d\beta_1}{b}(X^*-a) =\left(c+d\beta_0-\frac{d\beta_1a}{b}\right) +\frac{d\beta_1}{b}X^*. $$
Theorem: In the transformed units, the regression line has intercept and slope $$ \beta_0^*=c+d\beta_0-\frac{d\beta_1a}{b}, \qquad \beta_1^*=\frac{d\beta_1}{b}. $$ The transformed error is \(\varepsilon^*=d\varepsilon\). Thus, if the original conditional error variance is \(\sigma^2\), the transformed conditional error variance is \(d^2\sigma^2\).

The derivation also explains why the formula is valid: since \(b\ne0\), \(X^*\) and \(X\) determine each other, so conditioning on either predictor gives the same information. Further, \(E[\varepsilon^*\mid X^*]=dE[\varepsilon\mid X]=0\), and \(\operatorname{Var}(\varepsilon^*\mid X^*)=d^2\sigma^2\). If errors are normal, multiplying them by \(d\) preserves normality, changing their standard deviation to \(|d|\sigma\). Independence across observations is also preserved when the same fixed conversion is applied to each observation.

For an ordinary unit conversion that preserves direction, \(b\) and \(d\) are positive. The slope is multiplied by the response scale factor and divided by the predictor scale factor. If either conversion reverses direction, its factor is negative and the corresponding sign changes. The intercept requires the full formula whenever the zero point changes.

Worked Examples

Worked Example: Convert Hours and Dollars to Minutes and Cents

A hypothetical repair-cost model uses \(X\), the number of labor hours, to predict \(Y\), the repair cost in dollars. Assume \(Y=12+3.5X+\varepsilon\), with \(\varepsilon\sim N(0,2^2)\) independent of \(X\). Convert the model to predictor units of minutes and response units of cents. Then find the predicted cost for 90 minutes of labor and the transformed error standard deviation.

Method and conversion. Let \(X^*=60X\) be minutes and \(Y^*=100Y\) be cents. Here \(a=c=0\), \(b=60\), and \(d=100\). The intercept becomes \(100(12)=1200\) cents. The slope becomes \(\beta_1^*=100(3.5)/60=350/60=35/6\) cents per minute.

$$ E[Y^*\mid X^*]=1200+\frac{35}{6}X^*. $$

Prediction. For \(X^*=90\) minutes, the predicted cost is \(1200+(35/6)(90)=1200+525=1725\) cents, or $17.25. Checking in the original units, 90 minutes is \(90/60=1.5\) hours, and \(12+3.5(1.5)=12+5.25=17.25\) dollars, agreeing with the transformed prediction.

Error scale and check. The response was multiplied by 100, so the error standard deviation is \(100(2)=200\) cents. Its variance is \(200^2=40{,}000\) cents squared, also \(100^2(2^2)=10{,}000(4)=40{,}000\). The common mistake is to divide the slope by 60 but forget to multiply it by 100 when changing dollars to cents.

Worked Example: Convert a Calibration Model from Celsius to Fahrenheit

In a hypothetical sensor calibration, let \(X\) be the reference temperature in degrees Celsius and \(Y\) the sensor reading in degrees Celsius. Assume \(Y=2+0.8X+\varepsilon\), with \(\varepsilon\sim N(0,1.5^2)\) independent of \(X\). Convert both variables to degrees Fahrenheit, then predict the Fahrenheit reading when the reference temperature is \(50^\circ\)F.

Method and conversion. Fahrenheit and Celsius are related by \(X^*=32+1.8X\) and \(Y^*=32+1.8Y\). Thus \(a=c=32\), \(b=d=1.8\), \(\beta_0=2\), and \(\beta_1=0.8\). The new slope is \(1.8(0.8)/1.8=0.8\). The new intercept is \(32+1.8(2)-(0.8)(32)=32+3.6-25.6=10\).

$$ E[Y^*\mid X^*]=10+0.8X^*. $$

Prediction and check. At \(X^*=50^\circ\)F, the predicted reading is \(10+0.8(50)=50^\circ\)F. In Celsius, the reference is \((50-32)/1.8=10^\circ\)C. The original model predicts \(2+0.8(10)=10^\circ\)C; converting that result gives \(32+1.8(10)=50^\circ\)F. The two calculations agree.

Error scale and trap. The error standard deviation becomes \(1.8(1.5)=2.7^\circ\)F and the variance becomes \(2.7^2=7.29\) degrees Fahrenheit squared. A frequent error is to convert the slope by adding 32 or by multiplying it by 1.8 alone. The slope here is unchanged because both predictor and response are scaled by the same factor; the offsets affect the intercept, not the slope.

Worked Example: Express Repair Costs in Thousands of Dollars

A hypothetical model predicts annual repair costs \(Y\) in dollars from the number \(X\) of service visits: \(Y=240+18X+\varepsilon\). Assume \(\varepsilon\sim N(0,80^2)\) independently of \(X\). Keep \(X\) unchanged, express \(Y\) in thousands of dollars, and find the prediction and error standard deviation for 15 visits.

Method and conversion. Set \(X^*=X\) and \(Y^*=Y/1000\). Here \(a=b=c=0\), \(d=0.001\), so the intercept is \(0.001(240)=0.240\) thousand dollars and the slope is \(0.001(18)=0.018\) thousand dollars per visit:

$$ E[Y^*\mid X^*]=0.240+0.018X^*. $$

Prediction and check. At 15 visits, the prediction is \(0.240+0.018(15)=0.240+0.270=0.510\) thousand dollars, or $510. In dollars the original prediction is \(240+18(15)=240+270=510\), as required.

Error scale and trap. The transformed error standard deviation is \(0.001(80)=0.080\) thousand dollars, and its variance is \(0.080^2=0.0064\) thousand-dollars squared. A common mistake is to scale the standard deviation by 0.001 but scale the variance by 0.001 as well. Variance is multiplied by the square of the response conversion factor.

What Changes and What Remains Invariant

The coefficients are numerical descriptions in specified units, not unit-free properties. Their interpretations must always name those units. For example, a slope of 3.5 dollars per hour and a slope of 350 cents per hour describe the same rate, whereas changing the predictor to minutes gives a different numerical rate again.

QuantityEffect of \(X^*=a+bX,\;Y^*=c+dY\)Interpretation
Conditional meanBecomes the corresponding transformed linePredictions convert with the response units
Intercept\(c+d\beta_0-d\beta_1a/b\)Depends on both units and zero points
Slope\(d\beta_1/b\)Response units per predictor unit
Error standard deviation\(|d|\sigma\)Scales with the response
Error variance\(d^2\sigma^2\)Scales by the square of the response factor

The model's linear form and the zero conditional mean property remain intact. If the same fixed response conversion is used for every observation, constant conditional variance remains constant, though its numerical value changes. If the predictor and response are both multiplied by positive constants, their correlation is unchanged; if exactly one is multiplied by a negative constant, the correlation's sign reverses. These statements concern transformations of the same variables and observations, not a claim that all numerical regression summaries are invariant.

An estimated regression line transforms by the same algebra as any line: substitute the transformed variables into the reported equation. This is useful for communicating results in practical units. It does not mean that units can be ignored when interpreting a coefficient, or that a transformed intercept describes an observation near the data if the predictor value zero is far outside the observed range.

Common Exam Traps

  • Using only one conversion factor for the slope. The new slope is the response factor divided by the predictor factor, times the old slope.
  • Ignoring an offset. Fahrenheit conversions include 32, so the intercept must be recomputed with the full expression; the slope formula alone is not enough.
  • Scaling variance like a standard deviation. Standard deviation is multiplied by \(|d|\), while variance is multiplied by \(d^2\).
  • Giving a coefficient without its units. State, for example, “cents per minute,” not just “5.833.”
  • Assuming the intercept is unchanged whenever the slope is unchanged. Both Fahrenheit variables use the same scale factor, leaving the slope unchanged, but their offsets change the intercept.
Key takeaway: For affine unit changes, transform the slope by the response scale divided by the predictor scale, then calculate the intercept using both scale and origin changes. Predictions, errors, and variances must be converted consistently with the response.

Check Your Understanding

For each problem, identify the unit conversion before calculating the transformed model.

  1. A model predicts \(Y=5+2X\), where \(X\) is measured in days and \(Y\) in dollars. Convert \(X\) to weeks using \(X^*=X/7\) and \(Y\) to thousands of dollars using \(Y^*=Y/1000\). State the transformed intercept and slope. (Answer: \(0.005+0.014X^*\), in thousands of dollars.)
  2. A temperature model is \(E[Y_C\mid X_C]=4+0.5X_C\), with both variables in Celsius. Convert both to Fahrenheit. State the new intercept and slope. (Answer: \(E[Y_F\mid X_F]=23.2+0.5X_F\).)
  3. A model in minutes is \(E[Y\mid X]=15+3X\), with \(X\) unchanged. Convert the response to hours. If the original error standard deviation is 0.4 minutes, give the transformed line and error standard deviation. (Answer: \(0.25+0.05X\) hours; error standard deviation \(1/150\) hour, approximately \(0.0067\) hour.)
  4. A line is \(E[Y\mid X]=3+4X\). Define a reversed predictor scale by \(X^*=10-X\), keeping \(Y\) unchanged. Find the transformed intercept and slope. (Answer: \(43-4X^*\).)
  5. If \(X^*=2X\) and \(Y^*=-3Y\), express the transformed slope in terms of \(\beta_1\), and give the transformed error variance if the original variance is \(\sigma^2\). (Answer: slope \(-3\beta_1/2\); variance \(9\sigma^2\).)
Clinical Biostats