If a linear mixed model is used, all categorical variables must be modeled as a random effect. This function identifies the variable class to scale numeric variables and model categorical variables as a random effect. Additionally, variables are scaled to account for multiple variables that might have an order of magnitude difference.
build_formula(
md,
primary_variable,
model_variables = NULL,
is_num = NULL,
num_var = NULL,
random_effect = NULL,
exclude_variables = NULL,
add_model = NULL
)
A data frame with sample identifiers in a column and relevant experimental covariates.
Vector of variables that will be collapsed into a single fixed effect interaction term.
Optional. Vector of variables to include in the linear (mixed) model.
If not supplied, the model will include all variables in md
.
Is there a numerical covariate to use as an interaction with the primary variable(s). default= NULL
A numerical metadata column to use in an inaction with the primary variable(s). default= NULL
A vector of variables to consider as random effects instead of fixed effects.
Vector of variables to exclude from testing.
Optional. User Speciffied variables to add to the null model apriori to model generation. (Default = NULL)