createMAICInput {maic}R Documentation

Construct a MAIC input matrix

Description

From index patient level data and a set of target baseline characteristics, construct the input matrix to the maic.

Usage

createMAICInput(index, target, dictionary, matching.variables, x = FALSE)

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

x

Return subject level inputs?

Details

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

In addition, the following vector may be necessary:

and, for estimating some p-values on difference (e.g. in proportion)

It is possible to use these match types to match on other variables 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 maic.input

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)

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

wts <- maicWeight(ipmat)

rcv <- reportCovariates(
  stackloss, target, dict, 
  matching.variables = 
    c("airflow", "watertemp", 
      "acidconc", "min.airflow"),
  wts)

[Package maic version 0.1.4 Index]