Hello Statalist members,
I have a question on how to use the stepwise function for logistic regression of a binary variable . I'm trying to see what variables in my model have a good Hosmer -Lemeshow goodness of fit. Since my model includes ~15 variables, I'd like to use the stepwise function.
My current code is the following (I have factor variables):
xi: stepwise, pr(.05): logistic hospital i.race_eth i.revagebin gender hx*
After finding the variables that have significance, I run the Hosmer -Lemeshow fit function :
lfit, group(10) table
My results still show a H-L goodness of fit < 0.05. 1) Why is this happening even though my variables are each significant? 2) Is there a stepwise function on a goodness of fit threshold? 3) Is there another option other than the stepwise function that you would recommend?
Thanks for your help!
Louise
I have a question on how to use the stepwise function for logistic regression of a binary variable . I'm trying to see what variables in my model have a good Hosmer -Lemeshow goodness of fit. Since my model includes ~15 variables, I'd like to use the stepwise function.
My current code is the following (I have factor variables):
xi: stepwise, pr(.05): logistic hospital i.race_eth i.revagebin gender hx*
After finding the variables that have significance, I run the Hosmer -Lemeshow fit function :
lfit, group(10) table
My results still show a H-L goodness of fit < 0.05. 1) Why is this happening even though my variables are each significant? 2) Is there a stepwise function on a goodness of fit threshold? 3) Is there another option other than the stepwise function that you would recommend?
Thanks for your help!
Louise
Comment