Computes mean and variance statistics for individual-level patient data using various approaches, including Matching-Adjusted Indirect Comparison (MAIC), Simulated Treatment Comparison (STC), and G-computation via Maximum Likelihood Estimation (MLE) or Bayesian inference.
Usage
calc_IPD_stats(strategy, ipd, ald, scale, ...)
# Default S3 method
calc_IPD_stats(...)
# S3 method for class 'mim'
calc_IPD_stats(strategy, ipd, ald, scale, ...)
# S3 method for class 'stc'
calc_IPD_stats(strategy, ipd, ald, scale, var_method = "sample", ...)
# S3 method for class 'maic'
calc_IPD_stats(strategy, ipd, ald, scale, var_method = "sample", ...)
# S3 method for class 'gcomp_ml'
calc_IPD_stats(strategy, ipd, ald, scale, var_method = "sample", ...)
# S3 method for class 'gcomp_stan'
calc_IPD_stats(strategy, ipd, ald, scale, var_method = "sample", ...)
Arguments
- strategy
A list corresponding to different approaches
- ipd
Individual-level patient data. Dataframe with one row per patient with outcome, treatment and covariate columns.
- ald
Aggregate-level data. Single row matrix with summary statistics for each covariate and treatment outcomes. The format is 'mean.' and 'sd.' for covariates and 'y..sum', 'y..bar', 'y.*.sd' for treatments B and C. We assume a common distribution for each treatment arm.
- scale
A scaling parameter for the effect calculation.
- ...
Additional arguments
Value
A list containing:
- mean
Estimated mean treatment effect.
- var
Estimated variance of the treatment effect.
Multiple imputation marginalisation
Using Stan, compute marginal relative treatment effect for A vs C for each MCMC sample
by transforming from probability to linear predictor scale. Approximate by
using imputation and combining estimates using Rubin's rules, in contrast to calc_IPD_stats.gcomp_stan()
.
Simulated treatment comparison statistics
IPD from the AC trial are used to fit a regression model describing the observed outcomes \(y\) in terms of the relevant baseline characteristics \(x\) and the treatment variable \(z\).
Matching-adjusted indirect comparison statistics
Marginal A vs C treatment effect estimates using bootstrapping sampling.
G-computation maximum likelihood statistics
Compute a non-parametric bootstrap with default \(R=1000\) resamples.
G-computation Bayesian statistics
Using Stan, compute marginal log-odds ratio for A vs C for each MCMC sample by transforming from probability to linear predictor scale.
Examples
if (FALSE) { # \dontrun{
strategy <- strategy_maic()
ipd <- data.frame(id = 1:100, treatment = sample(c("A", "C"), 100, replace = TRUE), outcome = rnorm(100))
ald <- data.frame(treatment = c("A", "C"), mean = c(0.2, 0.1), var = c(0.05, 0.03))
calc_IPD_stats(strategy, ipd, ald, scale = "log_odds")
} # }