Learn R Programming

linea (version 0.1.1)

decomping: decomping

Description

Variable decomposition of linear regression

Usage

decomping(
  model = NULL,
  de_normalise = TRUE,
  categories = NULL,
  tail_window = NULL,
  verbose = FALSE
)

Value

a list of 3 data.frame's representing the variable and category decomposition, and the fitted values.

Arguments

model

Model object

de_normalise

A boolean to specify whether to apply the normalisation

categories

data.frame mapping variables to groups

tail_window

for time series, length of tail

verbose

A boolean to specify whether to print warnings

Details

Calculates the decomposition of the independent variables based on an input model object. This can be expanded by leveraging id variables (e.g. date) and categories (i.e. groups of variables).

Examples

Run this code
run_model(data = mtcars,dv = 'mpg',ivs = c('wt','cyl','disp'),decompose=FALSE) %>% decomping()

Run the code above in your browser using DataLab