How to get all R squared values in Stepwise regression?
9 views (last 30 days)
Show older comments
Hello,
I have a dataset and I want to do some sensitivity analysis to rank my independent variables based on their effect on the output. I want to use Stepwise regression. However, it just shows the final and overall R squared value (for the final model) when it finishes its job. Is there any way to force Matlab to print R squared values in each step, while it's adding one new term to the model?
So, in each step, I will be able to measure the importance of each term.
Thank you,
0 Comments
Answers (1)
the cyclist
on 19 Feb 2014
If you are using stepwisefit(), look at the "history" output, which has the RMSE value at each step. You can calculate R^2 from the RMSE.
If you are using stepwise(), which is the interactive version of stepwise regression, you can see the value of R^2 at each step.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!