View source: R/mrct_core_summary.R
| mrct_core_summary | R Documentation |
The rows of the regional-consistency core table, computed from one
mrct_region_sims() result run with record = "full". Everything is read from the
result: its per-trial columns and its "estimators" attribute.
mrct_core_summary(res)
res |
A |
The rows, with their denominators:
power: P(ITT ub < 1.0), of all trials.
trigger: trials reaching the trigger (ITT ub < 1.0 and region ITT > 1.0), of all
trials.
declared: a subgroup declared, of the triggered trials.
sens_nonregion, spec_nonregion, sens_region, spec_region: the sensitivity
and specificity of \hat H against H^*, trial by trial, averaged over
the declared triggered trials. A trial where one is undefined does not enter its
average.
declared_Ghat_lt1: declared and region(\hat G) < 1.0, of the triggered
trials.
Gstar_lt1: region(G^*) < 1.0, of the triggered trials.
declared_Ghat_ge1: declared and region(\hat G) not below 1.0, of the
triggered trials.
Ghat_share: the share of the region's patients kept in \hat G, trial by
trial, averaged over the declared triggered trials.
A plain data frame with one row per quantity above, in that order:
quantity, label: the row's key and its description.
estimate: the value, in percent.
se: its standard error, in percent, as the core table carries it: binomial for
the proportions, sd / sqrt(n) over the trials for the Sens and Spec averages,
NA for trigger and Ghat_share, which the core table gives without one.
count: the trials counted (NA for an average).
denominator: the trials the row is taken over.
display: the value as printed, at one decimal (for trigger, "K of N").
A row with no trial in its denominator has estimate NA and display an en
dash. Without a flag_harm column in the simulated trials, the Sens, Spec and
Gstar_lt1 rows are NA.
mrct_region_sims(), mrct_select_case().
set.seed(1)
n <- 400
d <- data.frame(age = rnorm(n, 50, 10), lab = rnorm(n, 300, 100),
f1 = rbinom(n, 1, 0.4), treat = rbinom(n, 1, 0.5))
d$tte <- rexp(n, 0.05 * exp(-0.5 * d$treat))
d$event <- as.integer(d$tte < 40)
d$tte <- pmin(d$tte, 40)
dgm <- suppressWarnings(inject_mrct_structure(
d, outcome_var = "tte", event_var = "event", treatment_var = "treat",
continuous_vars = c("age", "lab"), factor_vars = "f1", x_pred = "lab",
spline_spec = list(knot = 300, zeta = 800, log_hrs = rep(log(0.55), 3)),
region = list(prevalence = 0.25, or_pred = 1, x1_vars = "f1", or_x1 = 3,
loghr = -log(3), band = list(cut = 230, or = 1)),
x3 = list(vars = "lab", cuts = list(lab = 230), loghr = log(3 / 0.55)),
n_super = 2000, expand = "bootstrap", seed = 7L,
continuous_vars_cens = c("age", "lab"), factor_vars_cens = "f1"))
dgm <- scale_dgm_hazard(dgm, m = 3)
res <- mrct_region_sims(
dgm, n_sims = 8, n_sample = 800, region_var = "z_region", sg_focus = "hrMaxSG",
confounders.name = analysis_covariates(dgm, "observed"), conf_force = character(0),
fs_args = list(use_grf = FALSE, use_lasso = FALSE),
sim_args = list(rand_ratio = 1, draw_treatment = TRUE, max_entry = 6, cens_adjust = 20),
analysis_time = 30, cens_adjust = 20, parallel_args = list(plan = "sequential"),
details = FALSE, verbose_n_sims = 0, seed = 5000L, record = "full")
mrct_core_summary(res)[, c("quantity", "estimate", "se", "denominator", "display")]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.