IC {ICglm} | R Documentation |
Information Criteria
Description
Calculates Various Information Criteria for "lm" and "glm" objects.
Usage
IC(
model,
criteria = c("AIC", "BIC", "CAIC", "KIC", "HQIC", "FIC", "ICOMP_IFIM_C1",
"ICOMP_PEU_C1", "ICOMP_PEU_LN_C1", "CICOMP_C1"),
...
)
Arguments
model |
a "lm" or "glm" object or object list |
criteria |
a vector of criteria names. Can be set to respective numbers. Possible criteria names at the moment are: |
... |
additional parameters. Currently none. |
Details
Calculates Various Information Criteria for "lm" and "glm" objects.
model
can be a list. If it is a list, function returns a
matrix of selected information criteria for all models.
Value
Information criteria of the model(s) for selected criteria
Examples
x1 <- rnorm(100, 3, 2)
x2 <- rnorm(100, 5, 3)
x3 <- rnorm(100, 67, 5)
err <- rnorm(100, 0, 4)
## round so we can use it for Poisson regression
y <- round(3 + 2*x1 - 5*x2 + 8*x3 + err)
m1 <- lm(y~x1 + x2 + x3)
m2 <- glm(y~x1 + x2 + x3, family = "gaussian")
m3 <- glm(y~x1 + x2 + x3, family = "poisson")
IC(model = m1, criteria = 1:32)
IC(model = list(lm = m1,
glm = m2,
glm_pois = m3), criteria = 1:32)