Statistical Procedures

Programming the statistical procedures from SAS
BookmarkSubscribeRSS Feed
Saylor_Hardin
Calcite | Level 5

I'm having trouble assessing goodness of fit of a conditional logistic regression model. Below is my code:

 

Libname BSIII "/home/u62213366/BSIII";
data lowbwt13;
set BSIII.lowbwt13;
run;
proc print data=lowbwt13; run;

proc logistic data=lowbwt13 desc;
model low= smoke/expb;
strata str;
run;

 

Here is where I have fit a prediction model for 1:3 matched data using conditional logistic. 

proc logistic data=lowbwt13 desc;
model low= smoke ptd ui lwt ht/expb selection=backward ;
strata str;
run;

OUTPUT--> leaves me ptd as the only covariate that met the criteria

 

/* Assess the goodness of fit of the model in
(e) using Hosmer-Lemeshow test, Deviance and Pearson Chisquare */
proc logistic data=lowbwt13 desc;
class ptd;
model low= ptd / lackfit aggregate scale=none ;
run; 

 

My output doesn't show me any numbers for Hosmer-Lemeshow test, Deviance and Pearson Chisquare. 

3 REPLIES 3
SteveDenham
Jade | Level 19

This is a guess, and perhaps @StatDave  could shed a bit more light on the subject.  Based on the documentation, as near as I can tell, you fit "ptd" in the first model as a continuous variable, and in the second as a categorical variable. If you have a lot of different values for ptd, you may be exhausting the degrees of freedom available for the Hosmer-Lemeshow test. The solution may be as simple as adding CLASS ptd statement to the first model. It may not be that simple, so please remember that this is just a guess.

 

SteveDenham

StatDave
SAS Super FREQ

Goodness of fit statistics generally require the predicted probabilities from the model, but the conditional model doesn't produce the usual predicted probabilities as are available from the ordinary, unconditional model because the conditional model does not estimate strata-level intercepts. However, a likelihood-based R-square statistic can be computed and is available with the RSQUARE option in the MODEL statement.

Ksharp
Super User
Try GOF option of model.
model low= smoke ptd ui lwt ht/expb selection=backward GOF ;

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

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.

Discussion stats
  • 3 replies
  • 838 views
  • 2 likes
  • 4 in conversation