Learn R Programming

expirest (version 0.1.6)

get_xformed_variables: Transformation of variables

Description

The function get_xformed_variables() transforms the variables as needed.

Usage

get_xformed_variables(
  data,
  response_vbl,
  time_vbl,
  xform = c("no", "no"),
  shift = c(0, 0)
)

Value

The provided data frame with (a) new column(s) of the transformed variable(s).

Arguments

data

A data frame with the columns specified by response_vbl, time_vbl and batch_vbl.

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.

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 \(\leq 0\) are log or square root transformed. The default is c(0, 0).

Details

The function get_xformed_variables() transforms the variables (response_vbl and/or time_vbl) as specified by the parameters xform and shift.

See Also

expirest_osle, expirest_wisle.