SPSS Statistics

SPSS Statistics

Your hub for statistical analysis, data management, and data documentation. Connect, learn, and share with your peers! 

 View Only
Expand all | Collapse all

Calculating Hosmer-Lemeshow based on calibration curve in SPSS

  • 1.  Calculating Hosmer-Lemeshow based on calibration curve in SPSS

    Posted Wed February 22, 2023 09:50 AM
    Edited by S B Wed February 22, 2023 09:51 AM

    I am validating a prognostic model that predicts mortality. Based on data (outcome and prediction) of 5000 patients, I have created a calibration curve plotting predicted vs. observed mortality using the steps of visual binning into 10 categories of predictions, aggregate mean of outcome based on binned variables in 10 categories, and then graphing the calibration plot (https://stats.stackexchange.com/questions/96501/calibration-curve-in-spss). I would now like to calculate the Hosmer-Lemeshow goodness of fit based on this plot to attain a p-value. What are the (syntax) steps I need to follow in SPSS? Thanks in advance. 



    ------------------------------
    S B
    ------------------------------



  • 2.  RE: Calculating Hosmer-Lemeshow based on calibration curve in SPSS

    Posted Wed February 22, 2023 02:10 PM
    Edited by Rick Marcantonio Wed February 22, 2023 02:10 PM

    Hi. I asked one of our statisticians if he had anything handy for this, and he replied:

    The calculations for the H-L test are pretty simple once you have observed and expected counts for the 0 and 1 response categories for the deciles. Assuming you have a data set with ten cases with o1 and o2 variables holding the observed counts for the two categories and e1 and e2 variables holding the expected counts, you can use:

     

    matrix.
    
    get o /variables=o1 o2.
    
    get e /variables=e1 e2.
    
    compute hlstat=msum(((o-e)&**2)&/e).
    
    compute df=nrow(o)-2.
    
    compute sig=1-chicdf(hlstat,df).
    
    print {hlstat,df,sig}.
    
    end matrix.



    ------------------------------
    Rick Marcantonio
    Quality Assurance
    IBM
    ------------------------------