ExtractAIC.glm | R Documentation |
For glm fits the family's aic() function is used to compute the AIC.
The choice between different criteria is done by setting a global option AIC. It can be checked using show.option=TRUE.
Indeed, it is not possible to use the ... parameter due to a bug in some functions of MASS package. If you want to use this function as a replacement for setpAIC(), do extractAIC.glm <- ExtractAIC.glm before.
ExtractAIC.glm(fit, scale = 0, k = 2, ...)
fit |
fitted model, the result of a fitter glm. |
scale |
unused for glm. |
k |
numeric specifying the ‘weight’ of the equivalent degrees of freedom (=: edf) part in the AIC formula. |
... |
further arguments (currently unused because addterm.glm and dropterm.glm using this function do not transmit them). |
ExtractAIC.glm returns AIC, AICc or BIC from a glm object
A numeric named vector of length 2, with first and second elements giving
edf the ‘equivalent degrees of freedom’ for the fitted model fit.
x the Information Criterion for fit.
Modified from stats:::extract.AIC.glm
Other AIC:
FormatCompareAIC()
,
compare_AIC()
,
compare_AICc()
,
compare_BIC()
extractAIC.glm <- ExtractAIC.glm
n <- 100
x <- rnorm(n, 20, 2)
A <- rnorm(n, 20, 5)
g <- glm(x ~ A)
extractAIC(g, show.option=TRUE)
options(AIC="AIC")
extractAIC(g)
options(AIC="BIC")
extractAIC(g)
options(AIC="AICc")
extractAIC(g)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.