Learn R Programming

MAICtools (version 0.1.1)

check_matching: Check Whether the Variables are Balanced After Weighting

Description

Check Whether the Variables are Balanced After Weighting

Value

A data frame containing all specified variables summarised before and after weighting.

Arguments

ipds_wts

A data frame containing individual patient data from the intervention study, with a column containing the estimated weights (derived using estimate_weights).

agds

A data frame containing aggregate summary data from the comparator study.

summary.list

A character list with two elements giving the names of variables for summarizing: the first is a vector of binary variables, and the second is a vector of continuous variables. The variable names must match the column names in ipds and do not need to be the same as those in matching.list. Use c() if a type is absent.

matching.list

A character list with two elements giving the names of variables for matching: the first is a vector of binary variables, and the second is a vector of continuous variables. The variable names must match the column names in ipds and agds. Use c() if a type is absent.

intervention.arm

The name of the grouping column in the data frame specified by ipds, e.g., intervention.arm = TRT. The default is TRT.

comparator

The name of the study column in the data frame specified by agds, e.g., comparator = STUDY. The default is STUDY.

comparator.study

A character specifying the comparator study, which must be quoted and cannot be empty (e.g., comparator.study = "Study XX-1"). This is the value of the study column in agds set by the comparator parameter.

comparator.arm

The name of the grouping column in the data frame specified by agds, e.g., comparator.arm = TRT. The default is TRT.

comparator.n

The name of the subjects number column in the data frame specified by agds, e.g., comparator.n = N. The default is N.

wt.col

The name of the estimated weights column in the data frame specified by ipds_wts. The default is wt.

Examples

Run this code
# \donttest{
cov <- list(
  binary = c("ECOG", "SMK", "METBRAIN"),
  continuous = c("BMI", "DIAG")
)

cov_all <- list(
  binary = c("SEX", "ECOG", "SMK", "METBRAIN", "METLIVER"),
  continuous = c("BMI", "DIAG", "WEIGHT", "HEIGHT")
)

baseline <- check_matching(
  ipds_wts = pts, agds = AgD_bl,
  summary.list = cov_all, matching.list = cov,
  intervention.arm = TRT,
  comparator = STUDY, comparator.study = "Study XX-1",
  comparator.n = N, comparator.arm = TRT)

baseline
# }

Run the code above in your browser using DataLab