I have a binomial GLM:

site.fit = glm(Presence/Total~Site, family = binomial, weights = Total, data = site.dt)

-this looks at how the proportion of data (of the total) which meets the 'present' value (as opposed to absent) varies for each 'site'.

I understand that with a binomial GLM I can use the hoslem test to check the fit, but it's not clear to me how I would apply it with proportional data? Thanks in advance for your help!

  • $\begingroup$ A few things. Hosmer-Lemeshow is a test for calibration more than anything. Some papers have recommended avoiding it (see here). Additionally, if you want to use glm for binomial data, you need to use cbind(Presence, Total-Presence) and not Presence/Total. $\endgroup$ Sep 15 at 2:32
  • $\begingroup$ I believe glm can do binomial proportions if also supplied the denominator, as long as its done right $\endgroup$
    – Glen_b
    Sep 15 at 16:49
  • $\begingroup$ Thanks @Glen_b, I get the same output regardless of which way I write the glm command? Are there no tests to be done, is it necessary? I am also wondering, is it necessary to test for overdispersion if I only have categorical explanatory variables? $\endgroup$ Sep 16 at 3:44
  • $\begingroup$ I was just responding to DP's comment, but I think "necessary" is the wrong way to frame the question. I rarely test for overdispersion (its p-value is much less important than its size; in sufficiently large samples you're almost always going to find the dispersion parameter is not 1). We should admonish ourselves any time we find ourselves imagining our models to be correct -- until the urge to test assumptions lapses, to be replaced with a more prosaic but useful one. However, if the assumption is far wrong, our inferences are not reliable, whatever the form of the IVs. $\endgroup$
    – Glen_b
    Sep 16 at 5:24

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.