Calculate Hosmer Lemeshow (HL) Test with Excel

Hosmer and Lemeshow Test (HL)

It measures the association between actual events and predicted probability. In other words, it is a measure of how close the predicted probabilities are to the actual rate of events.

In HL test, null hypothesis states that sample of observed events and non-events supports the claim about the predicted events and non-events. In other words, the model fits data well.

  1. Calculate estimated probability of events
  2. Split data into 10 sections based on ascending order of probability
  3. Calculate number of actual events and non-events in each section
  4. Calculate Predicted Probability = 1 by averaging probability in each section
  5. Calculate Predicted Probability = 0 by subtracting Predicted Probability=1 from 1
  6. Calculate expected frequency by multiplying number of cases by Predicted Probability = 1
  7. Calculate chi-square statistics taking frequency of observed (actual) and predicted events and non-events
Hosmer Lemeshow Test
Rule : If p-value > .05. the model fits data well.
Calculate Hosmer Lemeshow Test with Excel
Related Posts
About Author:

Deepanshu founded ListenData with a simple objective - Make analytics easy to understand and follow. He has over 10 years of experience in data science. During his tenure, he has worked with global clients in various domains like Banking, Insurance, Private Equity, Telecom and Human Resource.

2 Responses to "Calculate Hosmer Lemeshow (HL) Test with Excel"
  1. HI Deepanshu I was looking at the attached excel for HL in excel. In the column H, you do an average of all probability (irrespective of dependent variable =0 or 1) and then put that average value in Column I. I was wondering if that is the correct way or we need to filter only those probabilities where dependent variable =1 and then average those probabilities?


Next → ← Prev
Love this Post? Spread the Word!