關於 logistic regression 的進階補充:Hosmer-Lemeshow goodness of fit test in R

Hosmer-Lemeshow goodness of fit test 這個統計檢定可用於檢定(由模型所產生的)期望值與觀察值(資料)之間適配的程度,也就是協助評估模型所作的預測的表現是否符合如模型本身所帶來預期(符合預期 p>.1為佳)。

這是在SPSS進階模組中才有的功能。令人欣慰的是,在R也有相對應的套件與指令。

In SPSS (Regression Module)

請同學看完這篇文章及操作影片,以便進一步瞭解這個hoslem檢定
http://thestatsgeek.com/2014/02/16/the-hosmer-lemeshow-goodness-of-fit-test-for-logistic-regression/
https://www.youtube.com/watch?v=MYW8gA1EQCQ

只是,這個方法並非神燈,也不少人提出了質疑,其中我很尊敬的、寫過"Missing Data"小綠書的Prof. Paul Allison 認為這個hoslem不可靠,
"The large sample size issue is a potential problem with ANY goodness of fit test. With large sample sizes, even trivial departures from the model specification are likely to show up as statistically significant. Actually, simulation results suggest that the HL test has relatively LOW power for detecting certain kinds of model specification, especially interactions."
http://statisticalhorizons.com/hosmer-lemeshow



其他相似的、可用的套件
MKmisc:: HLgof.test
http://www.inside-r.org/packages/cran/MKmisc/docs/HLgof.test

PredictABEL::plotCalibration
http://www.genabel.org/PredictABEL/plotCalibration.html