Skip to contents

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, analysis_params, ...)

# Default S3 method
calc_IPD_stats(...)

# S3 method for class 'mim'
calc_IPD_stats(strategy, analysis_params, ...)

# S3 method for class 'stc'
calc_IPD_stats(strategy, analysis_params, var_method = "sample", ...)

# S3 method for class 'maic'
calc_IPD_stats(strategy, analysis_params, var_method = "sample", ...)

# S3 method for class 'gcomp_ml'
calc_IPD_stats(strategy, analysis_params, var_method = "sample", ...)

# S3 method for class 'gcomp_stan'
calc_IPD_stats(strategy, analysis_params, var_method = "sample", ...)

Arguments

strategy

A list corresponding to different modelling approaches

...

Additional arguments

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.

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 IPD comparator "A" vs reference "C" arms 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 for reference "C" and comparator "A" trial arms 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 IPD comparator treatment "A" vs reference treatment "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 relative effects for IPD comparator "A" vs reference "C" treatment arms for each MCMC sample by transforming from probability to linear predictor scale.

Examples

if (FALSE) { # \dontrun{
strategy <- strategy_maic()
ipd <- data.frame(trt = sample(c("A", "C"), 100, replace = TRUE),
                  X1 = rnorm(100, 1, 1),
                  y = rnorm(100, 10, 2))
ald <- data.frame(trt = c(NA, "B", "C", "B", "C"),
                  variable = c("X1", "y", "y", NA, NA),
                  statistic = c("mean", "sum", "sum", "N", "N"),
                  value = c(0.5, 10, 12, 20, 25))
calc_IPD_stats(strategy, ipd, ald, scale = "log_odds")
} # }