How do I obtain standarized coefficients when applying a stepwise multilinear regression?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Roberto Suarez-Moreno
am 16 Jul. 2019
Kommentiert: Roberto Suarez-Moreno
am 16 Jul. 2019
Hello everyon
I'm using the stepwisefit function between the predictor variable X(69,8) and the response variable y. Each column in X (predictor) is previously standardized as well as the response variable. After applying the function as follows: B = stepwisefit(X,y), only two predictors appears to be in the model given the statistical significance by default (0.05). The problem is that I expect these coefficients to range between +1 and -1 due to previous standardization, but the values are 2.0251 and -2.2983. I need them to be standardized so that I can calculate the percentage of explained variance by each one.
Thanks in advance for your help!
0 Kommentare
Akzeptierte Antwort
the cyclist
am 16 Jul. 2019
I'm not sure I would necessarily expect coefficients to be in that range, even for normalized variables. Can you quote a reference for that?
Here is one simple example of a straightforward OLS regression that defies your expectation. Granted, I am using highly negatively correlated explanatory variables.
N = 100;
x1 = randn(N,1);
x2 = -x1 + 0.2*randn(N,1);
y = 2 + 3*x1 + 4*x2 + 0.7*randn(N,1);
x1n = (x1 - mean(x1))/std(x1);
x2n = (x2 - mean(x2))/std(x2);
yn = (y - mean(y))/std(y);
Xn = [x1n,x2n];
mdl = fitlm(Xn,yn)
figure
scatter(x1n,x2n)
5 Kommentare
the cyclist
am 16 Jul. 2019
I don't have access to that paper.
If your explanatory variables are uncorrelated with each other, things are simple. The fraction of variance explained by each variable is the square of its correlation coefficient with the response variable. (You don't need a model for that.)
You can also double-check this as follows ...
If you call your function like this
[b,se,pval,inmodel,stats,nextstep,history] = stepwisefit(...)
then
history.rmse
will give the progression of RMSE as you add variables.
1 - history.rmse.^2
gives the progression of explained variance.
Because your explanatory variables are uncorrelated, the additional explained variance is due completely to the variable added to the model at that stage.
(There will be a bit of rounding error.)
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!