MATLAB Answers

How to remove effect of "in" predictors on "out" predictors in stepwiseregression?

24 views (last 30 days)
Qazi Haque
Qazi Haque on 3 Feb 2021
Commented: Qazi Haque on 4 Feb 2021
I am trying to understand how the effect of "in" predictors are removed from the "out" predictors in the native matlab code stepwisefit.m.
The code is doing the following but unfortunately I fail to understand why.
% Compute separate added-variable coeffs and their standard errors
xr = x - Q*(Q'*x); % remove effect of "in" predictors on "out" predictors
Any explanation as to what this is doing would be really helpful and highly appreciated.

Answers (1)

Jeff Miller
Jeff Miller on 3 Feb 2021
One way to think of it is that the "out" predictors will only improve the fit of the regression model if they bring in some new information not already provided by the "in" predictors. The "new" information provided by each "out" predictor is, by definition, information that is not already predictable from the "in" variables. So, to 'remove effect of "in" predictors on "out" predictors' is to extract the new information (xr) from the "out" predictors. The next step in the analysis will then be to see whether this new information actually improves predictions.
Hope that helps...

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!