Description Usage Arguments Format Details Value Note Author(s) References See Also Examples
Provides a Hosmer-Lemeshow statistic and table following logistic regression.
1 | HLTest(obj, g)
|
obj |
model name |
g |
number of groups |
The function has two arguments: model name, number of groups
HLTest is a post-estimation function for logistic regression, following the use of glm(). Usage displays a table of observed vs predicted groups and an overall H-L goodness-of-fit statistic.
list
HLTest must be loaded into memory in order to be effectve. As a function in LOGIT, it is immediately available to a user. My thanks to Bilger and Loughlin for the use of their function.
Adapted from Loughlin, T.M. in Bilder and Loughlin, 2015
Hilbe, J. M. (2015), Practical Guide to Logistic Regression, Chapman & Hall/CRC.
Bilder, C.R. and Loughlin, T.M. (2015), Analysis of Categorical Data with R, Chapman & Hall/CRC.
Hilbe, J. M. (2009), Logistic Regression Models, Chapman & Hall/CRC.
Hosmer, D.W., Lemeshow, S, and Sturdivant, R.X (2013), Applied Logistic Regression, 3rd ed, Wiley.
1 2 3 4 5 6 7 |
Y0 Y1 Y0hat Y1hat
[0.0213,0.278] 101 52 117.7 35.3
(0.278,0.309] 104 42 102.9 43.1
(0.309,0.325] 112 45 107.2 49.8
(0.325,0.339] 109 37 97.2 48.8
(0.339,0.352] 119 42 105.0 56.0
(0.352,0.366] 137 54 121.8 69.2
(0.366,0.373] 79 20 62.1 36.9
(0.373,0.387] 140 60 123.4 76.6
(0.387,0.402] 61 81 85.5 56.5
(0.402,0.409] 20 80 59.1 40.9
Hosmer and Lemeshow goodness-of-fit test with 10 bins
data: mylogit
X2 = 124.84, df = 8, p-value < 2.2e-16
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.