# Adjust for overdispersion in glm family = binomial (logit) model

#### lotw

##### New Member
I have an overdispersion problem in my model.. I have the following data:

y= succes/fail (%)
x= Var1 : Temperature data
m1<-glm(cbind(succes,fail)~Var1, data=data, family = binomial(logit))

HTML:
Call:
glm(formula = cbind(succes, fail) ~ Var1, family = binomial(logit),
data = data)

Deviance Residuals:
Min        1Q    Median        3Q       Max
-14.2244   -0.1595    1.8024    1.9983    6.9403

Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 1.196658   0.098642   12.13   <2e-16 ***
Var1           0.104118   0.004219   24.68   <2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

Null deviance: 2195.8  on 224  degrees of freedom
Residual deviance: 1769.5  on 223  degrees of freedom
AIC: 2008.8

Number of Fisher Scoring iterations: 6

I found a possible way to correct for the overdispersion:

HTML:
sigma2<-sum(residuals(m1,type = "pearson")^2)/222
summary(m1, dispersion=sigma2)

Call:
glm(formula = cbind(succes, fail) ~ Var1, family = binomial(logit),
data = data)

Deviance Residuals:
Min        1Q    Median        3Q       Max
-14.2244   -0.1595    1.8024    1.9983    6.9403

Coefficients:
Estimate   Std. Error  z value  Pr(>|z|)
(Intercept)  1.19666    0.41038   2.916    0.00355 **
Var1           0.10412    0.01755   5.932    3e-09 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 17.30784)

Null deviance: 2195.8  on 224  degrees of freedom
Residual deviance: 1769.5  on 223  degrees of freedom
AIC: 2008.8

Number of Fisher Scoring iterations: 6
Clearly it did something with my model but I can't find any confirmation if this is the right way to do it... Does someone know if this is the right way? And if not.. what would be the best way to do it..? Thank you so much !

#### hlsmith

##### Not a robit
Not completely familiar with R in this regard, so bare with me.

Y in the first model is success/fail, so odds, making it a logistic reg given the logit transformation. How are you defining overdispersion in that model and how would it come about in a logistic model?