Computes the mean difference in treatment effects using bootstrap resampling.
Arguments
- strategy
A list specifying the model strategy, including:
- R
Number of bootstrap replications.
- formula
A linear regression
formula
object.- family
A
family
object specifying the distribution and link function (e.g.,binomial
).- N
Synthetic sample size for g-computation.
- ipd
Individual patient data.
- ald
Aggregate-level data.
Value
A list containing:
- mean_A
Bootstrap estimates for comparator treatment group "A".
- mean_C
Bootstrap estimates for reference treatment group "C".
Examples
if (FALSE) { # \dontrun{
strategy <- list(
R = 1000,
formula = y ~ trt + age,
family = binomial(),
trt_var = "treatment",
N = 1000
)
ipd <- data.frame(trt = c("A", "C"),
y = c(1, 0),
age = c(30, 40))
ald <- data.frame()
calc_gcomp_ml(strategy, ipd, ald)
} # }