- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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):
Group | Total | Observed outcome = 4 | Observed outcome = 3 | Observed outcome = 2 | Observed outcome = 1 | Expected outcome = 4 | Expected outcome = 3 | Expected outcome = 2 | Expected outcome = 1 |
1 | 100 | 50 | 25 | 12 | 10 | 40.9 | 30.6 | 12.1 | 15.9 |
… | … | … | … | … | … | … | … | … | … |
10 | 100 | 10 | 15 | 20 | 55 | 13.2 | 22.5 | 18.0 | 46.7 |
Hosmer and Lemeshow Goodness-of-Fit Test | ||
Chi-Square | DF | Pr > ChiSq |
36.3246 | 26 | 0.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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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 .
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content