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 treatment group A.
- mean_C
Bootstrap estimates for treatment group C.
Examples
if (FALSE) { # \dontrun{
strategy <- list(
R = 1000,
formula = outcome ~ treatment + age,
family = binomial(),
N = 1000
)
ipd <- data.frame(treatment = c(0, 1), outcome = c(1, 0), age = c(30, 40))
ald <- data.frame()
calc_gcomp_ml(strategy, ipd, ald)
} # }