Build the logistic region model and draw Region on a population.
Source:R/mrct_inject_dgm.R
make_region_model.RdBuild the logistic region model and draw Region on a population.
Arguments
- pop
data.frame holding x_pred and x1_vars (natural scale)
- x_pred
name of the region-associated effect modifier (X2); NULL for no X2 term (regional imbalance only through x1_vars)
- or_pred
odds ratio for s(x_pred) -> Region (OR = 1: none)
- x1_vars
names of imbalanced-only covariates (X1); character(0) for none
- or_x1
odds ratios for the X1 terms (recycled)
- prevalence
target marginal P(Region = 1)
- scale_ref
data.frame used to define the scaling (default NULL, meaning pop)
- scale
"rank" (ECDF, default) or "minmax" (the paper's scaling)
- band
NULL (default, no band term), or list(var, cut, or): adds
log(or) * 1(df[[var]] <= cut)to the logit (var on its natural scale, not passed through s())