mid.breakdown {midr}R Documentation

Calculate MID Breakdown

Description

mid.breakdown() calculates the MID breakdown of a prediction of the MID model.

Usage

mid.breakdown(
  object,
  data = NULL,
  sort = TRUE,
  digits = 6L,
  format = c("%s", "%s, %s")
)

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

Arguments

object

a "mid" object.

data

a data.frame containing a single observation to be used to calculate the MID breakdown. If NULL, data is extracted from parent.env() based on the function call of the "mid" object.

sort

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

digits

an integer specifying the minimum number of significant digits.

format

a character vector of length two to be used as the formats of the sprintf() function for each value or pair of values of predictor variables.

x

a "mid.importance" object to be printed.

...

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

Details

mid.breakdown() returns an object of class "mid.breakdown".

Value

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

breakdown

the data frame containing the breakdown of the prediction.

data

the data frame containing the values of predictor variables used for the prediction.

intercept

the intercept of the MID model.

prediction

the predicted value.

Examples

data(airquality, package = "datasets")
mid <- interpret(Ozone ~ .^2, airquality, lambda = 1)
mbd <- mid.breakdown(mid, airquality[1L, ])
mbd

[Package midr version 0.5.0 Index]