How to do the Hosmer-Lemeshow test in R?

4

I have a set of data to make the logistic regression of the dependent childbirth variable that is qualitative binary.

With the command below I get the multivariate logistic model in the R program:

GLM.1 <- glm(parto ~ trabalho + financiamento + consulta, family=binomial(logit), data=Dataset)

The independent variables of this model are also qualitative binary.

I would like to know which R command to use to get the Hosmer-Lemeshow test to check if this model is set.

If you need to use a specific R package for this, I would like to know what this package would be and which function to use.

    
asked by anonymous 07.08.2017 / 20:26

2 answers

3

With a quick search in Stack Overflow in English and with the command RSiteSearch of own R I found 2 functions for such a test. hoslem.test of package ResourceSelection and logitgof of package generalhoslem

    
07.08.2017 / 20:35
1
What I know about the hosmer and lemeshow test is that this difference may be due to the grouping of the data, when the data are not multiples of ten or the amount of group for the statistical test, which in general is 10 , the groupings are different in the spss and resourseselection test in the r. For example with 105 samples in spss it groups the first 9 with 11 data and the last group with 6 while in the r with the resourse selection packet it tries to leave the same size of all groups, so some groups will get 11 others with 10 samples per group, which makes a difference in the result. I particularly do not know which one is the right one.

    
18.06.2018 / 20:02