3
$\begingroup$

I am studying the effect of categorical indepdent variables on a binary outcome. To do this, I have fitted a glm as following :

Mod = glm(Rep~Var1+Var2+Var3, data=x, family=binomial(link="logit"))

In an attempt to assess the goodness of fit for he model, I used the residual and null deviances to generate a R² (1-RES/NULL) and get very bad fit (0.02).

However, when I perfom a Hosmer and Lemeshow goodness of fit (GOF) test, as follow, I get a p-value of 1.

hoslem.test(x$Rep, fitted(Mod))

My question is, how to interpret such contradictory results and what could explain the poor fit of the model ? (I selected the one with the lowest AIC, and it returns significant results for explanatory variables)

Edit for more information : My sample size is about 700 observations

$\endgroup$
  • 2
    $\begingroup$ Very broad speaking, a low R^2 is not bad fit to data. If there is little signal in the data relative to noise, then a measure of the strength of the relationship would indicate low signal if the measure does its job right. And if your sample size is large enough, then your predictors might be statistically significant since you may have the power to detect weak relationships. In your situation, one probably needs more information to say more. $\endgroup$ – Heteroskedastic Jim May 19 at 18:09
  • $\begingroup$ Hi ! Thank you very much for your answer, it clarifies a lot ;) Also I read here : personalpages.manchester.ac.uk/staff/Mark.Lunt/stats/7_Binary/… that R² wasn't the most appropriate in the case of logistic regression so this would explain my results. $\endgroup$ – MoEco May 20 at 15:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.