Learn R Programming

AICcmodavg (version 2.3-3)

useBIC: Computing BIC or QBIC

Description

Functions to compute the Bayesian information criterion (BIC) or a quasi-likelihood analogue (QBIC).

Usage

useBIC(mod, return.K = FALSE, nobs = NULL, ...) 

# S3 method for aov useBIC(mod, return.K = FALSE, nobs = NULL, ...)

# S3 method for betareg useBIC(mod, return.K = FALSE, nobs = NULL, ...)

# S3 method for clm useBIC(mod, return.K = FALSE, nobs = NULL, ...)

# S3 method for clmm useBIC(mod, return.K = FALSE, nobs = NULL, ...)

# S3 method for coxme useBIC(mod, return.K = FALSE, nobs = NULL, ...)

# S3 method for coxph useBIC(mod, return.K = FALSE, nobs = NULL, ...)

# S3 method for fitdist useBIC(mod, return.K = FALSE, nobs = NULL, ...)

# S3 method for fitdistr useBIC(mod, return.K = FALSE, nobs = NULL, ...)

# S3 method for glm useBIC(mod, return.K = FALSE, nobs = NULL, c.hat = 1, ...)

# S3 method for glmmTMB useBIC(mod, return.K = FALSE, nobs = NULL, c.hat = 1, ...)

# S3 method for gls useBIC(mod, return.K = FALSE, nobs = NULL, ...)

# S3 method for gnls useBIC(mod, return.K = FALSE, nobs = NULL, ...)

# S3 method for hurdle useBIC(mod, return.K = FALSE, nobs = NULL, ...)

# S3 method for lavaan useBIC(mod, return.K = FALSE, nobs = NULL, ...)

# S3 method for lm useBIC(mod, return.K = FALSE, nobs = NULL, ...)

# S3 method for lme useBIC(mod, return.K = FALSE, nobs = NULL, ...)

# S3 method for lmekin useBIC(mod, return.K = FALSE, nobs = NULL, ...)

# S3 method for maxlikeFit useBIC(mod, return.K = FALSE, nobs = NULL, c.hat = 1, ...)

# S3 method for mer useBIC(mod, return.K = FALSE, nobs = NULL, ...)

# S3 method for merMod useBIC(mod, return.K = FALSE, nobs = NULL, ...)

# S3 method for lmerModLmerTest useBIC(mod, return.K = FALSE, nobs = NULL, ...)

# S3 method for multinom useBIC(mod, return.K = FALSE, nobs = NULL, c.hat = 1, ...)

# S3 method for nlme useBIC(mod, return.K = FALSE, nobs = NULL, ...)

# S3 method for nls useBIC(mod, return.K = FALSE, nobs = NULL, ...)

# S3 method for polr useBIC(mod, return.K = FALSE, nobs = NULL, ...)

# S3 method for rlm useBIC(mod, return.K = FALSE, nobs = NULL, ...)

# S3 method for survreg useBIC(mod, return.K = FALSE, nobs = NULL, ...)

# S3 method for unmarkedFit useBIC(mod, return.K = FALSE, nobs = NULL, c.hat = 1, ...)

# S3 method for vglm useBIC(mod, return.K = FALSE, nobs = NULL, c.hat = 1, ...)

# S3 method for zeroinfl useBIC(mod, return.K = FALSE, nobs = NULL, ...)

Value

useBIC returns the BIC or the number of estimated parameters, depending on the values of the arguments.

Arguments

mod

an object of class aov, betareg, clm, clmm, clogit, coxme, coxph, fitdist, fitdistr, glm, glmmTMB, gls, gnls, hurdle, lavaan, lm, lme, lmekin, maxlikeFit, mer, merMod, lmerModLmerTest, multinom, nlme, nls, polr, rlm, survreg, vglm, zeroinfl, and various unmarkedFit classes containing the output of a model.

return.K

logical. If FALSE, the function returns the information criterion specified. If TRUE, the function returns K (number of estimated parameters) for a given model.

nobs

this argument allows to specify a numeric value other than total sample size to compute the BIC (i.e., nobs defaults to total number of observations). This is relevant only for mixed models or various models of unmarkedFit classes where sample size is not straightforward. In such cases, one might use total number of observations or number of independent clusters (e.g., sites) as the value of nobs.

c.hat

value of overdispersion parameter (i.e., variance inflation factor) such as that obtained from c_hat. Note that values of c.hat different from 1 are only appropriate for binomial GLM's with trials > 1 (i.e., success/trial or cbind(success, failure) syntax), with Poisson GLM's, single-season occupancy models (MacKenzie et al. 2002), dynamic occupancy models (MacKenzie et al. 2003), or N-mixture models (Royle 2004, Dail and Madsen 2011). If c.hat > 1, useBIC will return the quasi-likelihood analogue of the information criteria requested and multiply the variance-covariance matrix of the estimates by this value (i.e., SE's are multiplied by sqrt(c.hat)). This option is not supported for generalized linear mixed models of the mer or merMod classes.

...

additional arguments passed to the function.

Author

Marc J. Mazerolle

Details

useBIC computes the Bayesian information criterion (BIC, Schwarz 1978): $$BIC = -2 * log-likelihood + K * log(n),$$ where the log-likelihood is the maximum log-likelihood of the model, K corresponds to the number of estimated parameters, and n corresponds to the sample size of the data set.

In the presence of overdispersion, a quasi-likelihood analogue of the BIC (QBIC) will be computed, as $$QBIC = \frac{-2 * log-likelihood}{c-hat} + K * log(n),$$ where c-hat is the overdispersion parameter specified by the user with the argument c.hat. Note that BIC or QBIC values are meaningful to select among gls or lme models fit by maximum likelihood. BIC or QBIC based on REML are valid to select among different models that only differ in their random effects (Pinheiro and Bates 2000).

References

Burnham, K. P., Anderson, D. R. (2002) Model Selection and Multimodel Inference: a practical information-theoretic approach. Second edition. Springer: New York.

Dail, D., Madsen, L. (2011) Models for estimating abundance from repeated counts of an open population. Biometrics 67, 577--587.

MacKenzie, D. I., Nichols, J. D., Lachman, G. B., Droege, S., Royle, J. A., Langtimm, C. A. (2002) Estimating site occupancy rates when detection probabilities are less than one. Ecology 83, 2248--2255.

MacKenzie, D. I., Nichols, J. D., Hines, J. E., Knutson, M. G., Franklin, A. B. (2003) Estimating site occupancy, colonization, and local extinction when a species is detected imperfectly. Ecology 84, 2200--2207.

Pinheiro, J. C., Bates, D. M. (2000) Mixed-effect models in S and S-PLUS. Springer Verlag: New York.

Royle, J. A. (2004) N-mixture models for estimating population size from spatially replicated counts. Biometrics 60, 108--115.

Schwarz, G. (1978) Estimating the dimension of a model. Annals of Statistics 6, 461--464.

See Also

AICc, bictab, bictabCustom, useBICCustom

Examples

Run this code
##cement data from Burnham and Anderson (2002, p. 101)
data(cement)
##run multiple regression - the global model in Table 3.2
glob.mod <- lm(y ~ x1 + x2 + x3 + x4, data = cement)

##compute BIC with full likelihood
useBIC(glob.mod, return.K = FALSE)

##compute BIC for mixed model on Orthodont data set in Pinheiro and
##Bates (2000)
if (FALSE) {
require(nlme)
m1 <- lme(distance ~ age, random = ~1 | Subject, data = Orthodont,
          method= "ML")
useBIC(m1, return.K = FALSE)
}

Run the code above in your browser using DataLab