data(efc)
# goodness-of-fit test for logistic regression
efc$services <- dicho(efc$tot_sc_e, "v", 0, asNum = TRUE)
fit <- glm(services ~ neg_c_7 + c161sex + e42dep,
data = efc,
family = binomial(link = "logit"))
hoslem_gof(fit)
Run the code above in your browser using DataLab