Learn R Programming

linea (version 0.1.1)

re_run_model: re_run_model

Description

Re-run a linear regression model

Usage

re_run_model(
  model,
  data = NULL,
  dv = NULL,
  ivs = NULL,
  trans_df = NULL,
  id_var = NULL,
  pool_var = NULL,
  model_table = NULL,
  normalise_by_pool = FALSE,
  verbose = FALSE,
  decompose = TRUE
)

Value

Model object

Arguments

model

the model object used as the starting point of the re-run

data

data.frame containing variables included in the model specification

dv

string of the dependent variable name

ivs

character vector of the independent variables names

trans_df

data.frame defining the non-linear transformations to apply

id_var

string of id variable name (e.g. date)

pool_var

string of pool variable name (e.g. country)

model_table

data.frame as created in the build_model_table function

normalise_by_pool

A boolean to specify whether to apply the normalisation

verbose

A boolean to specify whether to print warnings

decompose

A boolean to specify whether to generate the model decomposition

Details

Re-run a linear regression model using the function output of running linea::run_model.

Examples

Run this code
model = run_model(mtcars,ivs = 'cyl', dv = 'mpg',save_all_raw_data = TRUE)
re_run_model(model,ivs = c('disp','cyl','wt'))

Run the code above in your browser using DataLab