0
$\begingroup$

I have (mydata) as example:

mydata <- read.csv("https://stats.idre.ucla.edu/stat/data/binary.csv")
## view the first few rows of the data
head(mydata)

mydata$rank <- factor(mydata$rank)
mylogit <- glm(admit ~ gre + gpa + rank, data = mydata, family = "binomial")

summary(mylogit)

I try to see if I have model overdispersion:

458.52/394 #[1] 1.163756 Almost 1!!!

But I not sure ... there is the package AER that makes the overdispersion test for Poisson and Binomial Negative and for Binomial there is any option?

Thanks in advance!

$\endgroup$
1

1 Answer 1

0
$\begingroup$

By Ben Bolker and others (https://bbolker.github.io/mixedmodels-misc/glmmFAQ.html#overdispersion)

overdisp_fun <- function(model) {
    rdf <- df.residual(model)
    rp <- residuals(model,type="pearson")
    Pearson.chisq <- sum(rp^2)
    prat <- Pearson.chisq/rdf
    pval <- pchisq(Pearson.chisq, df=rdf, lower.tail=FALSE)
    c(chisq=Pearson.chisq,ratio=prat,rdf=rdf,p=pval)
}

overdisp_fun (mylogit)

#      chisq       ratio         rdf           p 
#397.4901989   1.0088584 394.0000000   0.4412888

Not overdispersion model!!!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.