How can I get the Hosmer &Lemesahaw Goodness of Fit test to work on scored data, ( i.e. I want to score new data using a previously fitted model and get this test)
I'm using proc logistic to predict the probability y =1 (as an example)
When I develop the model using 5 years of data I test the model against the developmental data and ask for an ROC curve plot, area, % of correct predictions ( from a classification table) and the Hosmer and Lemeshaw Goodness of fit test.
I also want to score a 'validation' data set ( for this year's data). To do this ( by guessing) I ad a line of code:
SCORE DATA = PROJECTS.DATA_08 OUT= SCORE2 OUTROC = ROC_DATA FITSTAT;
This appears to give me the ROC plot and Fit Statistics for the 2008 data, but of course, I can't figure out how to get the Hosmer & Lemeshaw test on the 'scored' developmental data. ( I can't find a way to add a 'LACKFIT' option anywhere as I did for the developmental data set in the MODEL statment.
Here is the code I'm using in whole:
ODS GRAPHICS ON;
ODS HTML;
PROC LOGISTIC PLOTS = ROC DATA = PROJECTS.DATA_02_07
CLASS
X1 X2 X3 /
PARAM =GLM;
MODEL Y (EVENT ='1') =
X1 X2 X3 X4 X5 /LACKFIT RSQ TECHNIQUE =NEWTON PPROB =.50 CTABLE
SCORE OUT = SCORE1 FITSTAT;
SCORE DATA = PROJECTS.ENRL_08 OUT= SCORE2 OUTROC = ROC_DATA FITSTAT;
/*THE ABOVE LINE APPEARS TO SCORE DESIGNATED DATA SET
GIVEN THE MODEL JUST DEVELOPED & GIVES A ROC PLOT, FITSTATS, NO HL*/
OUTPUT OUT=PRED RESDEV =RESDEV RESCHI =RESCHI H = HAT P = PHAT
LOWER =LCL UPPER = UCL PRED = PRED PREDPROB=(INDIVIDUAL CROSSVALIDATE)
PREDICTED=FV;
RUN;
Any suggestions?