maicMatching {maic}R Documentation

calculate MAIC weights

Description

From index patient level data and a set of target baseline characteristics, calculate MAIC weights.

Usage

maicMatching(
  index,
  target,
  dictionary,
  matching.variables,
  reporting.variables = NULL
)

Arguments

index

A matrix or data.frame containing patient-level data

target

A list containing target summary data

dictionary

A data frame containing the columns "match.id", "target.variable", "index.variable" and "match.type"

matching.variables

A character vector indicating the match.id to use

reporting.variables

A optional character vector of matches to report upon (defaults to matching.variables)

Details

The dictionary is a data frame containing at least 4 vectors:

In addition, the following vector may be necessary:

It is possible to use these match types to match on other variables, e.g. variance, by pre-processing the input correctly.

Finally, the matching.variables is a list or character vector containing match.ids to be acted upon in this MAIC.

Value

An object of class MaicAnalysis, with components weights and aggregate, containing the weights vector and the covariate aggregate data respectively

Examples

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

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

dict <- data.frame(
  "match.id" = 
    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", 
      "match.conc.lt.90", "Air.Flow"),
  "match.type" = 
    c("mean", "mean", "proportion", "min"), 
  stringsAsFactors = FALSE)

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

[Package maic version 0.1.4 Index]