create_formula.Rd
Programmatic way of constructing model formulas
create_formula(
dat,
outcome,
exposure,
covariates,
id_var,
method,
add_inter_exposure,
add_inter_exposure_specific,
add_splines_exposure,
df_splines,
threshold_smooth,
threshold_k
)
A dataframe containing the variables of interest. A dataframe.
A string indicating the outcome variable. A string.
A string indicating the exposure variable. A string.
A list of covariate names. A vector.
The variable name to be used to identify subjects. A string.
The name of the model to be fitted (e.g., glm
). A string.
Whether to add an interaction between the exposure and all the covariates. A bool.
A list of covariate names for which an interaction with the exposure is desired. A vector.
Whether to model the exposure with natural splines. A bool.
The degrees of freedom for the natural splines. An integer.
For GAMs, threshold for the number of unique values
of continuous variables. If the number of unique values is greater or equal than
this variable, the dimension of the basis used to represent the smooth term (k
),
is chosen automatically. An integer.