R/Statistics_functions.R
logist_multi_fun.RdExtracts adjusted odds ratios from a multivariable logistic regression model. Performs Wald tests for 2-category predictors and likelihood ratio tests (LRT) for predictors with more than 2 categories.
logist_multi_fun(
var_model,
var,
response,
data_fun,
multi_var_all = multi_var_all
)Character vector of variables included in the multivariable model.
Character. The specific categorical variable to extract results for.
Character. Name of binary outcome variable.
Data frame containing variables.
Character vector of full model candidate variables.
Used to determine whether var is included in var_model.
Number of digits to round OR and CI.
A matrix of adjusted ORs and p-values.
• Categorical levels are compared to the first level (reference).
• If var is not included in var_model, a blank row is returned.
• For >2 categories, LRT compares:
full model vs. model without the variable.