Skip to contents

Per-1-unit odds ratios of continuous predictors (systolic BP, glucose, eGFR) round to an uninformative 1.00 (1.00-1.00). This reports them per 1 SD (or a stated increment such as 10 mmHg) instead, with Wald 95% CIs, standardized betas and p-values. Mirror of Python omop_etl.odds_ratios.generate_table3_odds_ratios.

Usage

generate_table3_odds_ratios(
  model,
  X,
  y,
  feature_names = NULL,
  continuous_scale = "sd",
  labels = NULL,
  beta_places = 2L
)

Arguments

model

A fitted binomial stats::glm() (its coefficients and standard errors are used), or NULL to fit an unpenalised logistic regression here.

X

Data frame / matrix of predictors, in the model's coefficient order.

y

0/1 outcome, one value per row of X.

feature_names

Column names (default colnames(X)).

continuous_scale

"sd" reports non-binary predictors per 1 SD; a named vector / list c(systolic_bp = 10) sets the increment per predictor (others stay per 1 unit); NULL keeps everything per 1 unit. 0/1 predictors are always "Yes vs No".

labels

Optional named character vector of display names.

beta_places

Decimals for the standardized beta (default 2).

Value

A data.frame Variable, Increment, OR (95% CI), Std. beta, p_value plus numeric or, ci_low, ci_high.