Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

QAIC

Quasi AIC or AICc


Description

Calculate a modification of Akaike's Information Criterion for overdispersed count data (or its version corrected for small sample, “quasi-AICc”), for one or several fitted model objects.

Usage

QAIC(object, ..., chat, k = 2, REML = NULL)
QAICc(object, ..., chat, k = 2, REML = NULL)

Arguments

object

a fitted model object.

...

optionally, more fitted model objects.

chat

c-hat, the variance inflation factor.

k

the ‘penalty’ per parameter.

REML

optional logical value, passed to the logLik method indicating whether the restricted log-likelihood or log-likelihood should be used. The default is to use the method used for model estimation.

Value

If only one object is provided, returns a numeric value with the corresponding QAIC or QAICc; otherwise returns a data.frame with rows corresponding to the objects.

Note

c-hat is the dispersion parameter estimated from the global model, and can be calculated by dividing model's deviance by the number of residual degrees of freedom.

In calculation of QAIC, the number of model parameters is increased by 1 to account for estimating the overdispersion parameter. Without overdispersion, c-hat = 1 and QAIC is equal to AIC.

Note that glm does not compute maximum-likelihood estimates in models within the quasi- family. In case it is justified, it can be worked around by ‘borrowing’ the aic element from the corresponding ‘non-quasi’ family (see ‘Example’).

Consider using negative.binomial family models for overdispersed count data.

Author(s)

Kamil Bartoń

See Also

AICc, quasi family used for models with over-dispersion

Examples

options(na.action = "na.fail")

# Based on "example(predict.glm)", with one number changed to create
# overdispersion
budworm <- data.frame(
    ldose = rep(0:5, 2), sex = factor(rep(c("M", "F"), c(6, 6))),
    numdead = c(10, 4, 9, 12, 18, 20, 0, 2, 6, 10, 12, 16))
budworm$SF = cbind(numdead = budworm$numdead,
    numalive = 20 - budworm$numdead)

budworm.lg <- glm(SF ~ sex*ldose, data = budworm, family = binomial)
(chat <- deviance(budworm.lg) / df.residual(budworm.lg))

dredge(budworm.lg, rank = "QAIC", chat = chat)
dredge(budworm.lg, rank = "AIC")



## Not run: 
# A 'hacked' constructor for quasibinomial family object that allows for
# ML estimation
hacked.quasibinomial <- function(...) {
    res <- quasibinomial(...)
    res$aic <- binomial(...)$aic
    res
}
QAIC(update(budworm.lg, family = hacked.quasibinomial), chat = chat)

## End(Not run)

MuMIn

Multi-Model Inference

v1.43.17
GPL-2
Authors
Kamil Bartoń
Initial release
2020-04-14

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.