MATLAB Answers


The Hosmer-Lemeshow Goodness-of-Fit Test

Asked by Samuel
on 16 Apr 2012
Latest activity Answered by David Nielsen on 7 Jan 2017

Hi, I am not able to find any function to computation of Hosmer-Lemeshow test. I am trying to compute a quality of model for predicting of the defaults in credit risk modeling (logistic regression used.). Thank you


Log in to comment.


No products are associated with this question.

2 Answers

Answer by Prashanth Ravindran on 1 May 2013

Check out this website for the matlab code for HL test.



Log in to comment.

Answer by David Nielsen on 7 Jan 2017

I am taking the chance to bring a function I wrote to compute the HL test. However, I have tested it with different packages (i.e. R) and I get different results. Please also check the very clearifying answer to why that may be here.

The function for the HL test uses binning in quantiles with same number of observations.


Log in to comment.

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!