SAS Enterprise Guide

Desktop productivity for business analysts and programmers
BookmarkSubscribeRSS Feed
dsal
Calcite | Level 5

I would like to evaluate the goodness-of-fit in an ordinal logistic regression model (proportional odds). My outcome has 4 levels (1-4 with 4 being a more severe outcome). My understanding is that in order to run the Hosmer-Lemeshow Goodness-of-Fit Test in SAS, your outcome has to be binary. When I request this test in SAS 9.4 I get the message "LACKFIT is ignored since there are more than 2 response levels". However, when I run the same model in SAS enterprise v7.15, I get the an output for the test. 

 

This is what my code looks like (with some additional class variables that I didn't write down:

proc logistic data=cohort;
	class gender(ref='1') specialist_visit(ref='1') gp_visit(ref='1') ...../param=ref;
	model outcome (descending)= gender specialist_visit gp_visit .../lackfit;
run;

 

This is the output from sas enterprise ( I just listed the first and last line):

GroupTotalObserved
outcome
= 4
Observed
outcome
= 3
Observed
outcome
= 2
Observed
outcome
= 1
Expected
outcome
= 4
Expected
outcome
= 3
Expected
outcome
= 2
Expected
outcome
= 1
11005025121040.930.612.115.9
101001015205513.222.518.046.7

 

Hosmer and Lemeshow Goodness-of-Fit Test
Chi-SquareDFPr > ChiSq
36.3246260.0859

 

My question is: how is sas enterprise producing this outcome as I couldn't find any documentation on it. Is there an update to the enterprise version to allow this test to run there but not in sas 9.14? 

 

Thank you

4 REPLIES 4
ChrisHemedinger
Community Manager

The first things to verify are:

 - When using SAS Enterprise Guide, are you using the same version/install of SAS (your "SAS 9.4")?  Or are you connecting to another SAS environment (remote server).  Check SYSVLONG in each environment to see.

 

%put &=SYSVLONG;

 

- Next, when running in SAS Enterprise Guide some system options might be set differently.  I don't know which options could influence this, but comparing the output of PROC OPTIONS from each is a good idea.  One notable difference is that SAS Enterprise Guide sets options validvarname=ANY, where base SAS 9.4 has it as V7 by default.  Not sure how that could be a factor here, but you can test by submitting options validvarname=V7; ahead of your code in EG.

 

Chris

Register for SAS Innovate 2025!! The premier event for SAS users, May 6-9 in Orlando FL. Sign up now for the best deals!
Ksharp
Super User

Maybe H-L test is for your last model  gender=1 v.s. gender=4 .

And @Rick_SAS  wrote a blog about goodness of fit for ordinal logististic regression .

dsal
Calcite | Level 5

Thank you for your replies.

 

@ChrisHemedinger I have checked the versions, both are using 9.4. Changing the options of the validvarname didn't make any difference.

 

@Ksharp  If the H-L is being run for my last model (gender=1 v.s. gender=4), then why is it providing observed and expected values for the other levels? Also, would you mind providing the link to the blog on goodness of fit for ordinal logistic regression 

 

Thank you

sas-innovate-white.png

Join us for our biggest event of the year!

Four days of inspiring keynotes, product reveals, hands-on learning opportunities, deep-dive demos, and peer-led breakouts. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 2126 views
  • 0 likes
  • 3 in conversation