useBIC {AICcmodavg} | R Documentation |
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 class 'aov'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)
## S3 method for class 'betareg'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)
## S3 method for class 'clm'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)
## S3 method for class 'clmm'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)
## S3 method for class 'coxme'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)
## S3 method for class 'coxph'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)
## S3 method for class 'fitdist'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)
## S3 method for class 'fitdistr'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)
## S3 method for class 'glm'
useBIC(mod, return.K = FALSE, nobs = NULL, c.hat = 1,
...)
## S3 method for class 'glmmTMB'
useBIC(mod, return.K = FALSE, nobs = NULL, c.hat = 1,
...)
## S3 method for class 'gls'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)
## S3 method for class 'gnls'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)
## S3 method for class 'hurdle'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)
## S3 method for class 'lavaan'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)
## S3 method for class 'lm'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)
## S3 method for class 'lme'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)
## S3 method for class 'lmekin'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)
## S3 method for class 'maxlikeFit'
useBIC(mod, return.K = FALSE, nobs = NULL, c.hat =
1, ...)
## S3 method for class 'mer'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)
## S3 method for class 'merMod'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)
## S3 method for class 'lmerModLmerTest'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)
## S3 method for class 'multinom'
useBIC(mod, return.K = FALSE, nobs = NULL, c.hat = 1,
...)
## S3 method for class 'nlme'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)
## S3 method for class 'nls'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)
## S3 method for class 'polr'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)
## S3 method for class 'rlm'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)
## S3 method for class 'survreg'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)
## S3 method for class 'unmarkedFit'
useBIC(mod, return.K = FALSE, nobs = NULL, c.hat =
1, ...)
## S3 method for class 'vglm'
useBIC(mod, return.K = FALSE, nobs = NULL, c.hat = 1,
...)
## S3 method for class 'zeroinfl'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)
Arguments
mod |
an object of class |
return.K |
logical. If |
nobs |
this argument allows to specify a numeric value other than total
sample size to compute the BIC (i.e., |
c.hat |
value of overdispersion parameter (i.e., variance inflation factor)
such as that obtained from |
... |
additional arguments passed to the function. |
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).
Value
useBIC
returns the BIC or the number of estimated parameters,
depending on the values of the arguments.
Note
The actual (Q)BIC values are not really interesting in themselves, as they depend directly on the data, parameters estimated, and likelihood function. Furthermore, a single value does not tell much about model fit. Information criteria become relevant when compared to one another for a given data set and set of candidate models.
Author(s)
Marc J. Mazerolle
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
##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)
## Not run:
require(nlme)
m1 <- lme(distance ~ age, random = ~1 | Subject, data = Orthodont,
method= "ML")
useBIC(m1, return.K = FALSE)
## End(Not run)