How to standardize unstandardized beta coefficients

41 vues (au cours des 30 derniers jours)
Nuchto
Nuchto le 26 Nov 2017
Hi, I read once that unstandardized beta coefficients (from regress function) can be standardized by just dividing them by the std of the respective variable. However, some simulations in Matlab tell me this is wrong. The only way I know of getting standardized betas is just to use zscored variables in the regress function, but I was wondering if there is another was to turn unstandardized betas into standardized ones. Thank you.
  4 commentaires
Nuchto
Nuchto le 27 Nov 2017
Modifié(e) : Nuchto le 27 Nov 2017
This is what I mean:
% create IVs x1 and x2 and DV y as unstandardized variables
x1=rand(100,1)*30;
x2=rand(100,1)*2;
y=rand(100,1)*10;
% create column of ones
X=[ones(size(x1)) x1 x2];
% perform regression on these
beta1=regress(y,X)
% standardize variables and perform regression again
X=[ones(size(x1)) zscore(x1) zscore(x2)]; % attach ones
beta2=regress(zscore(y),X)
% beta2 should be equal to beta1(2)/std(x1) but it isn't
beta1(2)/std(x1)
beta2(2)
Nuchto
Nuchto le 30 Nov 2017
Anyone help?

Connectez-vous pour commenter.

Réponses (3)

David Goodmanson
David Goodmanson le 30 Nov 2017
Hi Nuchto
You forgot that you need to regress against the same y, otherwise it's apples and oranges. So the second regression should be
beta2=regress(y,X)
and in addition the comparison is
beta1(2)*std(x1)
beta2(2)
which does seem counterintuitive at first.
  1 commentaire
Nuchto
Nuchto le 7 Avr 2018
Mmm, thanks! Why does it seem counterintuitive? Thanks!

Connectez-vous pour commenter.


muqdad aljuboori
muqdad aljuboori le 4 Juin 2018
Modifié(e) : muqdad aljuboori le 4 Juin 2018
% create IVs x1 and x2 and DV y as unstandardized variables
x1=rand(100,1)*30;
x2=rand(100,1)*2;
y=rand(100,1)*10;
% create column of ones X=[ones(size(x1)) x1 x2];
% perform regression on these
beta1=regress(y,X)
% standardize variables and perform regression again
Z=[ones(size(x1)) zscore(x1) zscore(x2)]; % attach ones
beta2=regress(y,Z)
% beta2 should be equal to beta1(2)/std(x1) but it isn't
beta1(2)*std(x1)
beta2(2)
beta1(3)*std(x2)
beta2(3)
it is working now

muqdad aljuboori
muqdad aljuboori le 4 Juin 2018
% create IVs x1 and x2 and DV y as unstandardized variables x1=rand(100,1)*30;
x2=rand(100,1)*100;
x3=rand(100,1)*521;
x4=rand(100,1)*7;
y=rand(100,1)*10; % create column of ones
X=[ones(size(x1)) x1 x2 x3 x4];
% perform regression on these
beta1=regress(y,X)
% standardize variables and perform regression again
Z=[ones(size(x1)) zscore(x1) zscore(x2) zscore(x3) zscore(x4)]; % attach ones
beta2=regress(zscore(y),Z)
% beta2 should be equal to beta1(2)/std(x1) but it isn't
beta1(2)*std(x1)/std(y)
beta2(2)
beta1(3)*std(x2)/std(y)
beta2(3)
beta1(4)*std(x3)/std(y)
beta2(4)
beta1(5)*std(x4)/std(y)
beta2(5)
this for zscore(y)

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by