Free Access Week-  Data Engineering + BI
Data engineering and BI courses are free!
Free AI Access Week from June 2-8

expirest (version 0.1.6)

get_icpt_list: List of intercepts

Description

The function get_icpt_list() prepares a list of the intercepts of the regression models fitted to the data.

Usage

get_icpt_list(
  data,
  response_vbl,
  time_vbl,
  batch_vbl,
  model_list,
  xform = c("no", "no"),
  shift = c(0, 0)
)

Value

A list of four elements named cics, dics, dids.pmse and dids is returned. Each of them contains a list element named icpt with a vector of the intercepts. If the data have been transformed, each of the primary list elements contains a further list element called icpt.orig with a numeric vector of the intercepts on the original scale.

Arguments

data

The data frame that was used for fitting the models of parameter model_list.

response_vbl

A character string that specifies the response variable name that must be a column of data.

time_vbl

A character string that specifies the time variable name that must be a column of data.

batch_vbl

A character string that specifies the column in data with the grouping information (i.e. a factorial variable) for the differentiation of the observations of the various batches.

model_list

A list of regression models of different type. Usually, it is a list of four elements named cics, dics, dids.pmse and dids, where the first three elements contain ‘lm’ objects of the “common intercept / common slope” (cics), “different intercept / common slope” (dics) and “different intercept / different slope” (dids.pmse) type. The fourth element with the label dids is usually a list of the ‘lm’ objects that is obtained from fitting a regression model to the data of each level of the categorical variable separately. The dids.pmse model differs from the dids model in that it is a model with the categorical variable as a fixed main effect and with an interaction term of the categorical variable with the time variable, i.e. a model where the mean square error is pooled across batches (thus the “pmse” suffix meaning “pooled mean square error”). The cics, dics and dids.pmse elements are NA if data of only a single batch is available.

xform

A vector of two character strings that specifies the transformation of the response and the time variable. The default is “no” transformation, i.e. c("no", "no"), where the first element specifies the transformation of the x variable and the second element the transformation of the y variable. Valid alternatives for x and/or y variable transformation are "log" (natural logarithm), "sqrt" (square root) and "sq" (square).

shift

A vector of two values which will be added to the variables x and/or y before they are transformed as specified by the xform parameter, where the first element will be added to the x variable and the second element to the y variable. The purpose is to prevent an undefined state which could arise when variables with values of 0 are log or square root transformed. The default is c(0, 0).

Details

The function get_icpt_list() extracts the intercepts of the various regression models (fitted by aid of the lm() function) that are passed in via the model_list parameter.

See Also

get_model_list, get_icpt, expirest_osle, expirest_wisle.