Extracts 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
)

Arguments

var_model

Character vector of variables included in the multivariable model.

var

Character. The specific categorical variable to extract results for.

response

Character. Name of binary outcome variable.

data_fun

Data frame containing variables.

multi_var_all

Character vector of full model candidate variables. Used to determine whether var is included in var_model.

dig

Number of digits to round OR and CI.

Value

A matrix of adjusted ORs and p-values.

Details

• 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.

Examples

if (FALSE) { # \dontrun{
logist_multi_fun(
  var_model = c("Age", "Gender"),
  var       = "Gender",
  response  = "Y",
  data_fun  = mydata,
  multi_var_all = c("Age", "Gender", "BMI")
)
} # }