Formulas for modeling the propensity score. get_ps_formula() obtains the formulas and add_ps_formula() adds them to an existing analysis object.

get_ps_formula(
  splines = TRUE,
  interaction = TRUE,
  treat = "treat",
  keep_names = FALSE
)

add_ps_formula(x, splines = TRUE, interaction = TRUE)

Arguments

splines

Whether to use natural cubic splines (splines::ns()) for continuous variables.

interaction

Whether to include an interaction between cancer stage and days since diagnosis.

treat

Name of the treatment variable. Default is "treat".

keep_names

If TRUE, then analysis_id is used to name the list. Otherwise an unnamed list is returned.

x

An analysis object.

Value

get_ps_formula() returns a list of formulas. add_ps_formula() returns an analysis object with a new list column named ps_formula where each element is the formula used for a particular pairwise analysis.

See also