Dear colleagues,
I'd like to ask a question about the stepwiseglm function. I was wondering how the aic criterion works exactly for entering and removing terms. I understand how the process works if one considers a certain p-value threshold for entering (a term matches the treshold for entering) and removing (a variable in the existing model up to that point does not meet the threshold for staying in the model) terms. However, when it concerns the aic for the entire model, I do not readily understand how indivivual terms are entered and removed. I would appreciate your help.
Thanks!
Best
Hans

 採用された回答

the cyclist
the cyclist 2023 年 8 月 6 日

0 投票

Regardless of the criterion used (e.g. the default "Deviance" criterion, or the "AIC" criterion), the stepwise method brings in one variable at a time, but then makes a fit assessment of the whole model (not just that term):
  • For deviance, the metric for the criterion is the p-value of the F test* (which is a whole-model test).
  • For AIC, the metric is the AIC. (Again, a whole-model test.)
For details, see the Criterion section of the documentation for stepwiseglm. Also, look at the PEnter and PRemove parameters for the precise numeric values of the thresholds.
*Or chi-squared test

3 件のコメント

Hans van der Horn
Hans van der Horn 2023 年 8 月 6 日
Dear the cyclist,
Thanks so much for your aswer. So if I am understanding correctly, at each step forward selection is used to add terms based on PEnter, and this means that a term is added if the AIC improves (lowers based on a PEnter threshold). At the same time, it is evaluated if removing (previously added) terms would improve the AIC of the model (backward selection). Am I correct in understanding that for the latter PRemove is used?
Thanks,
Best
Hans
the cyclist
the cyclist 2023 年 8 月 6 日
編集済み: the cyclist 2023 年 8 月 6 日
I think you have the idea basically correct, but the default threshold for PRemove is not 0, but 0.01. (Quoting the documentation: "If the change in the AIC of the model is greater than PRemove, remove the term from the model.")
I don't think I can describe the process better than the Algorithms section of the documentation.
Hans van der Horn
Hans van der Horn 2023 年 8 月 6 日
All right, thanks so much for your answers! I think this level of understanding is enough for me.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Community Treasure Hunt

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

Start Hunting!

Translated by