R/Statistics_functions.R
logist_univar_fun.RdFits a univariate logistic regression model for a binary outcome and a categorical predictor. Returns odds ratios (OR), 95% confidence intervals, Wald p-values for 2-level predictors, and likelihood ratio test (LRT) p-values for predictors with >2 categories.
logist_univar_fun(data_fun, response, var)A character matrix with rows = levels of the variable and
columns = "OR (95% CI)" and "p value".
• Removes incomplete cases using only the variables in response and var.
• For categorical predictors with:
2 levels → Wald p-value for the coefficient
>2 levels → Likelihood ratio test (LRT) comparing model vs. intercept-only model
if (FALSE) { # \dontrun{
logist_univar_fun(mydata, response = "Y", var = "Gender")
} # }