permute.varimp: Permutation variable importance for regression

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/permute.varimp.R

Description

Calculate variable importance in a model by randomly permuting the values of each variable.

Usage

1
permute.varimp(fit, data = NULL, verbose = FALSE, ranef = TRUE)

Arguments

fit

a object of class lmerMod, glmerMod, glm, lm, or lrm.

data

the dataframe on which fit was estimated. Only necessary for lrm model objects.

verbose

logical. If TRUE the function will print updates when each predictor has been estimated.

ranef

logical. If fit is a merMod object, should the random effects terms be included in the ranking?

Details

For each predictor in the model, the values of that predictor are randomly permuted to break their association with the response, and the model is re-fit to a new dataset containing the permuted values. The fit of the new model is compared to that of the original model. Three measures of model fit are calculated: The concordance C, Accuracy (

Value

A dataframe with 3 columns and k rows, where k is the number of individual predictors in the model. Columns are as follows:

Predictor

name of predictor

C

difference in the concordance statistic C (a.k.a. AUC) between the original model and the model with the permuted predictor

accuracy

difference in the proportion of observations correctly predicted between the original model and the model with the permuted predictor

AICc

difference in the conditional AIC (see Burnham and Anderson 2002) between the original model and the model with the permuted predictor

Author(s)

J. Grafmiller

References

Burnham, K. P. and Anderson, D. R. (2002) Model selection and multimodel inference: a practical information-theoretic approach. 2nd ed. New York, Springer-Verlag.

See Also

AICc in MuMIn; somers2 in Hmisc

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
data(brown_genitives)

require(lme4)
require(languageR)
   
genitive.glmm = glmer(Type ~ PossrAnimacyBin + 
   PossrWordC + Genre + (1|Text), data = brown_genitives, 
   family = binomial, control = glmerControl(optimizer = "bobyqa"))

genitive.glmm.tab <- permute.varimp{genitive.glmm, brown_genitives}
## End(Not run)

jasongraf1/JGmermod documentation built on May 24, 2019, 9:54 p.m.