Calculates AICc-weights for each model of a set of models

Share:

Description

Calculates AICc-weights for each model of a set of models

Usage

1
AICweights(models)

Arguments

models

a vector of characters with the model names

Details

The AICc for small sample sizes is used (can also be applied for large samples)

Value

a vector of model weights

Note

The function uses the function AICc from the package MuMIn.

Author(s)

F. Korner

References

Burnham, KP and Anderson DR (2002) Model selection and multimodel inference, a practical information-theoretic approach. Springer, New York

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
data(periparusater)
dat<-periparusater
# preparation of the data
dat$age[dat$age==0] <- NA  # replace 0 with NA
dat$age[dat$age==5] <- 4   # replace "after hatching year" with "non-hatching year"
dat$age <- factor(dat$age) # 3 = hatching year, 4 = non hatching year
dat$sex[dat$sex==0] <- NA  # replace 0 by missing values
dat$sex <- factor(dat$sex) # 1 = males, 2 = females
# retain only those data where sex and age is not missing
dat <- dat[complete.cases(dat$sex, dat$age),] 


mod1 <- lm(wing~sex+age, data=dat)
mod2 <- lm(wing~sex*age, data=dat)
AICweights(c("mod1", "mod2"))

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.