Korina
Korina

Reputation: 61

Akaike criterion (AIC) for quasi-Poisson models

I run quasi-Poisson glm models in R and I want to compute AIC criterion. I run the code below but I am not sure if it is correct. Also, I find weird the fact that the AIC decreases while degrees of freedom increase.

fqaic <- function(model) {
  loglik <- sum(dpois(model$y, model$fitted.values, log = TRUE))
  phi <- summary(model)$dispersion
  qaic <- -2*loglik + 2*summary(model)$df[3]*phi
  return(qaic)
}

I would be grateful for any advice.

Upvotes: 1

Views: 3059

Answers (1)

Ben Bolker
Ben Bolker

Reputation: 226332

There are some notes here, indicating that among other things that there are existing methods for computing qAIC in the bbmle, AICcmodavg, and MuMIn packages. The correct formula for qAIC is

-2 * logLik/dispersion + 2 * df

Upvotes: 4

Related Questions