Asked by Chet
on 6 Aug 2013

Hi, I'm using stepwisefit on a dataset. As per the results, Matlab takes 10 steps to reach a final solution. I checked the stats.B and the history.B outputs to dig into the details. I can verify that the stats.B has only one column of data and that matches the final result (displayed) on the Command Window. However, when I look at the history.B data, I find that some of the numbers in the final vector do not match the final output. I was expecting the final vector to match across - i.e. the entire vector in stats.B should match the coeff's displayed in the Command Window (which they do) and the coeff's displayed in the last iteration in history.B (which does not). Can anyone help? Please let me know if you need more information. Ty Chet

Answer by the cyclist
on 6 Aug 2013

Accepted answer

Does this excerpt from the documentation answer your question?

==============

- If a term is not in the final model, then the corresponding coefficient estimate in b results from adding only that term to the predictors in the final model.

- If a term is in the final model, then the coefficient estimate in b for that term is a result of the final model, that is stepwise does not consider the terms it excluded from the model while computing these values.

Show 1 older comment

the cyclist
on 8 Aug 2013

Opportunities for recent engineering grads.

## 0 Comments