Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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]
share|improve this question
Could you please add the definition of "standardised regression coefficients"? – Dr. belisarius Feb 14 '13 at 17:35
@belisarius Done! – ダンボー Feb 14 '13 at 18:56
up vote 9 down vote accepted

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$.)

share|improve this answer
Thanks for the definition :) – Dr. belisarius Feb 14 '13 at 18:41
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"]]. – J. M. May 7 '13 at 1:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.