Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- goodness of fit proc logistic

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 02-11-2021 07:02 AM
(1485 views)

Hello,

I need help with choosing a goodness of fit test for binary logistic regression.

I have one independent variable, which is also categorical (binary) in nature. I got a not-so-fascinating c score of .54 and also a slightly moving-upward ROC curve.

I used the below code and obtained the below result:

proc logistic data=done.input_survey_v3 plots(maxpoints=none)=effect;

model Q6(event='1')=Q7 / aggregate scale=none;

run;

What does aggregate= option do? When must it be used?

Is Hosmer and Lemeshow GOF test meant for binary response data? I even tried that and got the same result - blanks.

I thank in advance for any help.

Regards,

MS

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

6 REPLIES 6

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

A lot is going to depend on the data you are fitting. Can you share that dataset?

SteveDenham

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hello @SteveDenham,

Attached is a sample of my data. Q6 is my dependent var. and Q7 my independent.

Thank you for taking the time to look into my data.

Regards,

MS

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Since both variables are binary, you really have just a 2x2 table that defines two proportions. There is no need to fit a model for such data. You can simply compare those two proportions using the CHISQ option in PROC FREQ.

Concerning PROC LOGISTIC, the goodness of fit statistics have zero degrees of freedom because, with just a single binary predictor, the model is saturated and there are no degrees of freedom remaining. The AGGREGATE option is used in more complex models if the data is collected in subpopulations defined more precisely than by the covariates in the model as further described in this note.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hello @StatDave,

Thank you for the explanation. It just slipped my mind that I could run a simple measures of association.

Having said that, I have seen several courses show fitting a model to such data (2 binary variables). Wouldn't the r2 always be too small in such cases? Obviously, the r2 value can't be improved as there are no independent variables to add.

I do look forward to your opinion.

Regards,

Mari

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Thank you @StatDave,. Really appreciate it.

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. **Registration is now open through August 30th**. Visit the SAS Hackathon homepage.

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.