Programming the statistical procedures from SAS

how to evaluate the model fit for logistic regression

Reply
Occasional Contributor
Posts: 7

how to evaluate the model fit for logistic regression

Hi all,

I am trying to build a logistic regression model: using 7 variables (see below) to predict college enrollment (Enroll vs. Not-Enroll). When I put all seven variables in the model, the Hosmer and Lemeshow Goodness-of-Fit Test is significant,  I think it suggests that the model does not fit the data well. I then tried variable selection and allowed two-way interactions to enter the selection, some of the interaction terms were selected for the final model, and the Hosmer and Lemeshow Goodness-of-Fit Test is still significant.


I also tried variable selection without including interaction terms. Four out of the seven variables were selected for the final model (race, sat score, legacy and year) and the Hosmer and Lemeshow Goodness-of-Fit p-value is significant as well. Does any one have suggestions on what I should do next?

A general question: Is the Hosmer and Lemeshow Goodness-of-Fit Test a good way to evaluate model fit?  What do you usually use to evaluate model fit for logistic regression?

Any suggestion is appreciated.

Yanmin

  1. Gender (Female vs. Male)
  2. Race (Non-US vs. Minority vs. White)
  3. SAT scores (numerical variable)
  4. Academic Interest (Sciences vs. Interdisciplinary vs. Humanities vs. Undecided vs. Social Sciences)
  5. Legacy (Yes vs. No)
  6. First generation (Yes vs. No)
  7. Year(2012 vs. 2013 vs. 2014)
Trusted Advisor
Posts: 1,195

Re: how to evaluate the model fit for logistic regression

Hi,

Did you compare default model fit statistics before considering Hosmer and Lemeshow?


Occasional Contributor
Posts: 7

Re: how to evaluate the model fit for logistic regression

Hi there,

Thanks so much for responding. My SAS code is below.

proc logistic data=asq;

class gender (ref='Male')  race (ref='White')   Aca_Ins (ref='Social Sciences')  legacy (ref='No')  first_gen(ref='No')  year(ref='2014')  /param=ref;

model  enroll (event='Enroll')= gender_r race SAT_sum  Aca_Ins legacy  first_gen year/lackfit ;

run;

for the default default model fit statistics, do you mean the following table? what should I compare to? Thank you!!

AIC4018.7293781.145
SC4024.7083858.872
-2 Log L4016.7293755.145
Trusted Advisor
Posts: 1,195

Re: how to evaluate the model fit for logistic regression

Yes, what about Testing Global Null Hypothesis: BETA=0?

Occasional Contributor
Posts: 7

Re: how to evaluate the model fit for logistic regression

Thank you!!!

I will read a bit more about logistic regression before continuing the analysis.  Will come back to you later. Smiley Happy

Grand Advisor
Posts: 16,862

Re: how to evaluate the model fit for logistic regression

Occasional Contributor
Posts: 7

Re: how to evaluate the model fit for logistic regression

Thank you so much Reeza! This is very helpful!

Ask a Question
Discussion stats
  • 6 replies
  • 269 views
  • 6 likes
  • 3 in conversation