aic.calc: Akaike Information Criterion with correction for sample size

Description Usage Arguments Value Author(s) Examples

View source: R/AIC_Calc.R

Description

Calculates AIC and AICc

Usage

1
aic.calc(formula, family, data, mu, n.eff = NULL)

Arguments

formula

A model formula

family

Family used to fit the model. gaussian, binomial, or poisson are supported

data

A data frame

mu

Fitted values from a model

n.eff

Effective number of observations. Default is NULL

Value

A list with the following components

loglik

Log likelihood of the model

df

Degrees of freedom

AIC

AIC score for the specified model

AICc

AIC score corrected for small sample sizes

Author(s)

Gudrun Carl, Sam Levin

Examples

1
2
3
4
5
6
7
data(musdata)
coords <- musdata[ ,4:5]
mglm <- glm(musculus ~ pollution + exposure, "poisson", musdata)

aic <- aic.calc(musculus ~ pollution + exposure, "poisson", musdata,
                mglm$fitted)
aic$AIC

spind documentation built on Jan. 13, 2021, 6:04 p.m.