Readme for package maic


maic is repeatable workflow for calculating subject/observation weights for Matching Adjusted Indirect Comparison (MAIC).

MAIC is a form of population adjustment for indirect comparison that can be undertaken when only aggregate data is available for the comparator intervention, but full subject-level data is available for the investigative intervention. By the method of moments, subject-level weights are generated such that the weighted moments of the baseline variables of the “index” intervention study match the reported moments of the “target” study. Via the first two moments (mean and variance) matching can be achieved on:

In addition, subjects can be assigned zero weight where there is no overlap with the target study, i.e.:

The generated weights may then be used to form weighted comparisons between intervention outcomes having removed bias for prognostic or effect modifying covariables.


You can install the released version of maic from CRAN with:


And the development version from GitHub with:

# install.packages("devtools")


This example demonstrates how to create the MAIC weights by creation of the configuration objects and running the optimisation procedure:

target <- c("Air.Flow" = 60,
           "Water.Temp" = 21,
           "Prop.Acid.Conc.LT.90" = 0.7,
           "min.air.flow" = 55)

stackloss$ <- 
  ifelse(stackloss$Acid.Conc. < 90, 1, 0)

dict <- data.frame(
  "" = 
    c("airflow", "watertemp", 
      "acidconc", "min.airflow"),
  "target.variable" = 
    c("Air.Flow", "Water.Temp",
      "Prop.Acid.Conc.LT.90", "min.air.flow"),
  "index.variable" = 
    c("Air.Flow", "Water.Temp",
      "", "Air.Flow"),
  "match.type" = 
    c("mean", "mean", "proportion", "min"),
  stringsAsFactors = FALSE)

ipmat <- createMAICInput(
  index = stackloss,
  target = target,
  dictionary = dict,
  matching.variables = 
    c("airflow", "watertemp", 
      "acidconc", "min.airflow"))

wts <- maicWeight(ipmat)