Function to help format input to the term_prep function. Initializes the sublist with the parameters for creating a new term based on an existing variable in a data frame.

term_new(
  label = "",
  coding = NULL,
  transformation = NULL,
  range = NULL,
  scale = NULL,
  order = NULL
)

Arguments

label

An optional label for the new term.

coding

A list with the parameters for recoding the base variable (see term_coding).

transformation

A character string with an R expression for transforming the base variable.

range

A vector with the range for the term.

scale

Either a logical value, or a named vector of the form c(m = ..., sd = ...) for standardizing the term.

order

A character vector that can be used to specify the order in which coding ('c'), transformations ('t'), and scaling ('s') are done.

Value

A list.