How can I ensure that "stepwiselm" only removes terms from a model without ever adding any?
1 view (last 30 days)
Show older comments
MathWorks Support Team
on 5 May 2016
Edited: MathWorks Support Team
on 4 Mar 2021
I am trying to do a stepwise regression in which I initially specify a regression model, and then remove insignificant terms from the pre-specified model, without adding any new terms. How can I do this using "stepwiselm"?
Accepted Answer
MathWorks Support Team
on 4 Mar 2021
Edited: MathWorks Support Team
on 4 Mar 2021
For "stepwiselm"s default SSE criterion, a term is added when the SSE is smaller than 'PEnter' and is removed when it is larger than 'PRemove'. You can therefore make sure that "stepwiselm" never adds a term when using the SSE criterion by setting the value of 'PEnter' to 0 (or less). You may need to specify a different value of 'PEnter' if using some other value of 'Criterion' - please refer to the following link for documentation on the behavior of 'PEnter' and 'PRemove' for different criteria:
You may, however, find that using the above method results in some desired terms not appearing in the computed model, since they may have been removed at some stage of the process without the ability to later add them back in. If this is the case, consider removing the PEnter = 0 property and instead use the 'Upper' input to "stepwiselm" to ensure that undesired terms are not added to the model. Details on how to supply the 'Upper' argument can also be found at the above link.
0 Comments
More Answers (0)
See Also
Categories
Find more on Schedule Model Components in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!