# importance: Compute Importance Values of Variable In AICcmodavg: Model Selection and Multimodel Inference Based on (Q)AIC(c)

## Description

This function calculates the relative importance of variables (w+) based on the sum of Akaike weights (model probabilities) of the models that include the variable. Note that this measure of evidence is only appropriate when the variable appears in the same number of models as those that do not include the variable.

## Usage

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134``` ```importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, ...) ## S3 method for class 'AICaov.lm' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, ...) ## S3 method for class 'AICbetareg' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, ...) ## S3 method for class 'AICsclm.clm' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, ...) ## S3 method for class 'AICclm' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, ...) ## S3 method for class 'AICclmm' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, ...) ## S3 method for class 'AICclogit.coxph' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, ...) ## S3 method for class 'AICcoxme' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, ...) ## S3 method for class 'AICcoxph' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, ...) ## S3 method for class 'AICglm.lm' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, c.hat = 1, ...) ## S3 method for class 'AICglmerMod' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, ...) ## S3 method for class 'AICgls' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, ...) ## S3 method for class 'AIClm' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, ...) ## S3 method for class 'AIClme' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, ...) ## S3 method for class 'AIClmekin' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, ...) ## S3 method for class 'AICmaxlikeFit.list' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, c.hat = 1, ...) ## S3 method for class 'AICmer' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, ...) ## S3 method for class 'AICmultinom.nnet' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, c.hat = 1, ...) ## S3 method for class 'AICnlmerMod' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, ...) ## S3 method for class 'AICpolr' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, ...) ## S3 method for class 'AICrlm.lm' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, ...) ## S3 method for class 'AICsurvreg' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, ...) ## S3 method for class 'AICunmarkedFitColExt' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, c.hat = 1, parm.type = NULL, ...) ## S3 method for class 'AICunmarkedFitOccu' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, c.hat = 1, parm.type = NULL, ...) ## S3 method for class 'AICunmarkedFitOccuFP' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, c.hat = 1, parm.type = NULL, ...) ## S3 method for class 'AICunmarkedFitOccuRN' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, c.hat = 1, parm.type = NULL, ...) ## S3 method for class 'AICunmarkedFitPCount' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, c.hat = 1, parm.type = NULL, ...) ## S3 method for class 'AICunmarkedFitPCO' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, c.hat = 1, parm.type = NULL, ...) ## S3 method for class 'AICunmarkedFitDS' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, c.hat = 1, parm.type = NULL, ...) ## S3 method for class 'AICunmarkedFitGDS' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, c.hat = 1, parm.type = NULL, ...) ## S3 method for class 'AICunmarkedFitMPois' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, c.hat = 1, parm.type = NULL, ...) ## S3 method for class 'AICunmarkedFitGMM' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, c.hat = 1, parm.type = NULL, ...) ## S3 method for class 'AICvglm' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, c.hat = 1, ...) ## S3 method for class 'AICzeroinfl' importance(cand.set, parm, modnames = NULL, second.ord = TRUE, nobs = NULL, ...) ```

## Arguments

 `cand.set` a list storing each of the models in the candidate model set. `parm` the parameter of interest for which a measure of relative importance is required. `modnames` a character vector of model names to facilitate the identification of each model in the model selection table. If `NULL`, the function uses the names in the cand.set list of candidate models. If no names appear in the list, generic names (e.g., `Mod1`, `Mod2`) are supplied in the table in the same order as in the list of candidate models. `second.ord` logical. If `TRUE`, the function returns the second-order Akaike information criterion (i.e., AICc). `nobs` this argument allows to specify a numeric value other than total sample size to compute the AICc (i.e., `nobs` defaults to total number of observations). This is relevant only for mixed models or various models of `unmarkedFit` classes where sample size is not straightforward. In such cases, one might use total number of observations or number of independent clusters (e.g., sites) as the value of `nobs`. `c.hat` value of overdispersion parameter (i.e., variance inflation factor) such as that obtained from `c_hat`. Note that values of c.hat different from 1 are only appropriate for binomial GLM's with trials > 1 (i.e., success/trial or cbind(success, failure) syntax), with Poisson GLM's, single-season occupancy models (MacKenzie et al. 2002), dynamic occupancy models (MacKenzie et al. 2003), or N-mixture models (Royle 2004, Dail and Madsen 2011). If `c.hat` > 1, `importance` will return the quasi-likelihood analogue of the information criteria requested and multiply the variance-covariance matrix of the estimates by this value (i.e., SE's are multiplied by `sqrt(c.hat)`). This option is not supported for generalized linear mixed models of the `mer` or `merMod` classes. `parm.type` this argument specifies the parameter type on which the effect size will be computed and is only relevant for models of `unmarkedFitOccu`, `unmarkedFitColExt`, `unmarkedFitOccuFP`, `unmarkedFitOccuRN`, `unmarkedFitMPois`, `unmarkedFitGPC`, `unmarkedFitPCount`, `unmarkedFitPCO`, `unmarkedFitDS`, `unmarkedFitGDS`, and `unmarkedFitGMM` classes. The character strings supported vary with the type of model fitted. For `unmarkedFitOccu` objects, either `psi` or `detect` can be supplied to indicate whether the parameter is on occupancy or detectability, respectively. For `unmarkedFitColExt`, possible values are `psi`, `gamma`, `epsilon`, and `detect`, for parameters on occupancy in the inital year, colonization, extinction, and detectability, respectively. For `unmarkedFitOccuFP` objects, one can specify `psi`, `detect`, or `fp`, for occupancy, detectability, and probability of assigning false-positives, respectively. For `unmarkedFitOccuRN` objects, either `lambda` or `detect` can be entered for abundance and detectability parameters, respectively. For `unmarkedFitPCount` and `unmarkedFitMPois` objects, `lambda` or `detect` denote parameters on abundance and detectability, respectively. For `unmarkedFitPCO` objects, one can enter `lambda`, `gamma`, `omega`, or `detect`, to specify parameters on abundance, recruitment, apparent survival, and detectability, respectively. For `unmarkedFitDS` objects, only `lambda` is supported for the moment. For `unmarkedFitGDS` objects, `lambda` and `phi` denote abundance and availability, respectively. For `unmarkedFitGMM` and `unmarkedFitGPC` objects, `lambda`, `phi`, and `detect` denote abundance, availability, and detectability, respectively. `...` additional arguments passed to the function.

## Value

`importance` returns an object of class `importance` consisting of the following components:

 `parm` the parameter for which an importance value is required. `w.plus` the parameter for which an importance value is required. `w.minus` the sum of Akaike weights for the models that exclude the parameter of interest

## Author(s)

Marc J. Mazerolle

## References

Burnham, K. P., and Anderson, D. R. (2002) Model Selection and Multimodel Inference: a practical information-theoretic approach. Second edition. Springer: New York.

Dail, D., Madsen, L. (2011) Models for estimating abundance from repeated counts of an open population. Biometrics 67, 577–587.

MacKenzie, D. I., Nichols, J. D., Lachman, G. B., Droege, S., Royle, J. A., Langtimm, C. A. (2002) Estimating site occupancy rates when detection probabilities are less than one. Ecology 83, 2248–2255.

MacKenzie, D. I., Nichols, J. D., Hines, J. E., Knutson, M. G., Franklin, A. B. (2003) Estimating site occupancy, colonization, and local extinction when a species is detected imperfectly. Ecology 84, 2200–2207.

Royle, J. A. (2004) N-mixture models for estimating population size from spatially replicated counts. Biometrics 60, 108–115.

`AICc`, `aictab`, `c_hat`, `confset`, `evidence`, `modavg`, `modavgShrink`, `modavgPred`

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59``` ```##example on Orthodont data set in nlme ## Not run: require(nlme) ##set up candidate model list Cand.models <- list( ) Cand.models[[1]] <- lme(distance ~ age, data = Orthodont, method = "ML") ##random is ~ age | Subject Cand.models[[2]] <- lme(distance ~ age + Sex, data = Orthodont, random = ~ 1, method = "ML") Cand.models[[3]] <- lme(distance ~ 1, data = Orthodont, random = ~ 1, method = "ML") Cand.models[[4]] <- lme(distance ~ Sex, data = Orthodont, random = ~ 1, method = "ML") ##create a vector of model names Modnames <- paste("mod", 1:length(Cand.models), sep = "") importance(cand.set = Cand.models, parm = "age", modnames = Modnames, second.ord = TRUE, nobs = NULL) ##round to 4 digits after decimal point print(importance(cand.set = Cand.models, parm = "age", modnames = Modnames, second.ord = TRUE, nobs = NULL), digits = 4) detach(package:nlme) ## End(Not run) ##single-season occupancy model example modified from ?occu ## Not run: require(unmarked) ##single season data(frogs) pferUMF <- unmarkedFrameOccu(pfer.bin) ## add some fake covariates for illustration siteCovs(pferUMF) <- data.frame(sitevar1 = rnorm(numSites(pferUMF)), sitevar2 = rnorm(numSites(pferUMF))) ## observation covariates are in site-major, observation-minor order obsCovs(pferUMF) <- data.frame(obsvar1 = rnorm(numSites(pferUMF) * obsNum(pferUMF))) ##set up candidate model set fm1 <- occu(~ obsvar1 ~ sitevar1, pferUMF) fm2 <- occu(~ 1 ~ sitevar1, pferUMF) fm3 <- occu(~ obsvar1 ~ sitevar2, pferUMF) fm4 <- occu(~ 1 ~ sitevar2, pferUMF) Cand.mods <- list(fm1, fm2, fm3, fm4) Modnames <- c("fm1", "fm2", "fm3", "fm4") ##compute importance value for 'sitevar1' on occupancy importance(cand.set = Cand.mods, modnames = Modnames, parm = "sitevar1", parm.type = "psi") ##compute importance value for 'obsvar1' on detectability importance(cand.set = Cand.mods, modnames = Modnames, parm = "obsvar1", parm.type = "detect") detach(package:unmarked) ## End(Not run) ```

### Example output

```Loading required package: nlme

Importance values of 'age':

w+ (models including parameter): 1
w- (models excluding parameter): 0

Importance values of 'age':

w+ (models including parameter): 1
w- (models excluding parameter): 0

Importance values of 'psi(sitevar1)':

w+ (models including parameter): 0.5
w- (models excluding parameter): 0.5

Importance values of 'p(obsvar1)':

w+ (models including parameter): 0.27
w- (models excluding parameter): 0.73
```

AICcmodavg documentation built on June 20, 2017, 9:04 a.m.