View source: R/mrct_inject_dgm.R
| make_region_model | R Documentation |
Build the logistic region model and draw Region on a population.
make_region_model(
pop,
x_pred = NULL,
or_pred = 1,
x1_vars = character(0),
or_x1 = 1,
prevalence = 0.2,
scale_ref = NULL,
scale = c("rank", "minmax"),
band = NULL
)
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
|
list(alpha0, coefs, band, prob = function(df), draw = function(df, seed))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.