AICweights: Calculate AIC weights

Description Usage Arguments Details Value Examples

View source: R/OUwieAvg.R

Description

This function takes a vector of AIC (Akaike Information Criterion) values and returns a vector of AIC weights using the formula from Burnham and Anderson (2002).

Usage

1
AICweights(AIC, na.rm = TRUE)

Arguments

AIC

A vector of values.

na.rm

Whether to remove NA values.

Details

If na.rm = FALSE and any values in AIC are NA, all returned values will be NA.

Value

A named vector of weights with names inherited from AIC.

Examples

1
2
3
4
5
6
AIC <- c(NA, 5, 10, 20, 25)
#ignore NAs
AICweights(AIC)

#should return all NAs
AICweights(AIC, na.rm = FALSE)

willgearty/pcmtools documentation built on Nov. 5, 2019, 12:20 p.m.