# Obtaining standardised regression coefficients

Regression coefficients are the constant that indicate the rate of change in one variable as a function of change in another. Standardised regression coefficients are the same, but refer to a change in number of standard deviations.

Using LinearModelFit and the "ParameterTable" property I am able to obtain unstandardised regression coefficients (parameter estimates), but I would like to know if there is a also a way to quickly obtain standardised regression coefficients.

What I am currently doing:

model = LinearModelFit[data, x, x]
model["ParameterTable"]

• Could you please add the definition of "standardised regression coefficients"? Feb 14, 2013 at 17:35
• @belisarius Done! Feb 14, 2013 at 18:56

There does not seem to be any way to obtain the betas directly from model, but we can compute them without having to re-fit anything.

A linear model fit is of the form $y = X b$ for a response vector $y$, design matrix $X$, and estimated coefficients $b$. By definition, the standardized coefficients $\beta$ are obtained by first rescaling the columns of $X$ to have unit variance and rescaling (and recentering) $y$ also to have unit variance and performing the fit. If column $i$ of $X$ (written $x_i$) has standard deviation $s_i$ and $y$ has SD $s_y$, then the usual fit is

$$y = \sum_i b_i x_i$$

and the standardized fit is of the form

$$y/s_y = \sum_i \beta_i \frac{x_i}{s_i}$$

Comparing the two expressions yields

$$\beta_i = b_i \frac{s_i}{s_y}.$$

The Mathematica calculation of this is

model["BestFitParameters"] / StandardDeviation[model["Response"]] (
StandardDeviation /@ Transpose[model["DesignMatrix"]])


(When the model includes a constant, the $\beta$ for it will necessarily equal $0$.)

• Since StandardDeviation[] acts on columns of a matrix (it acts like Total[] in this regard), one could replace StandardDeviation /@ Transpose[model["DesignMatrix"]] with StandardDeviation[model["DesignMatrix"]]. May 7, 2013 at 1:27