Skip to contents

mid.importance() calculates the MID importance of a fitted MID model.

Usage

mid.importance(object, data = NULL, weights = NULL, sort = TRUE, measure = 1L)

# S3 method for class 'mid.importance'
print(x, digits = max(3L, getOption("digits") - 2L), ...)

Arguments

object

a "mid" object.

data

a data frame containing the observations to be used to calculate the MID importance. If NULL, the fitted.matrix of the MID model is used.

weights

an optional numeric vector of sample weights.

sort

logical. If TRUE, the output data frame is sorted by MID importance.

measure

an integer specifying the measure of the MID importance. Possible alternatives are 1 for the mean absolute effect, 2 for the root mean square effect, and 3 for the median absolute effect.

x

a "mid.importance" object to be printed.

digits

an integer specifying the minimum number of significant digits to be printed.

...

additional parameters to be passed to print.data.frame() to print the importance of component functions.

Value

mid.importance() returns an object of the class "mid.importance" containing the following components.

importance

the data frame of calculated importances.

predictions

the matrix of the fitted or predicted MID values.

measure

the type of the importance measure.

Details

mid.importance() returns an object of class "mid.importance". The MID importance is defined for each component function of a MID model as the mean absolute effect in the given data.

Examples

data(airquality, package = "datasets")
mid <- interpret(Ozone ~ .^2, airquality, lambda = 1)
#> 'model' not passed: response variable in 'data' is used
imp <- mid.importance(mid)
imp
#> 
#> MID Importance based on 111 Observations
#> 
#> Measure: Mean Absolute Deviation
#> 
#> Importance:
#>             term importance order
#> 1           Temp   13.94096     1
#> 2           Wind   10.50540     1
#> 3        Solar.R    5.57458     1
#> 4            Day    4.39277     1
#> 5          Month    2.27995     1
#> 6   Solar.R:Wind    0.44950     2
#> 7  Solar.R:Month    0.37623     2
#> 8       Temp:Day    0.37148     2
#> 9     Wind:Month    0.36905     2
#> 10      Wind:Day    0.36547     2
#> 11     Month:Day    0.32260     2
#> 12     Wind:Temp    0.28060     2
#> 13   Solar.R:Day    0.26646     2
#> 14  Solar.R:Temp    0.23464     2
#> 15    Temp:Month    0.12076     2