check_matching2wider: Convert a Longer Table Generated by check_matching() Into a...

View source: R/check_matching2wider.R

check_matching2widerR Documentation

Convert a Longer Table Generated by check_matching() Into a Wider Table

Description

Convert a Longer Table Generated by check_matching() Into a Wider Table

Arguments

baseline.longer

A data frame containing the summarised results generated by check_matching().

intervention.arm

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

digits

Specify the number of decimal places for the output results.

Value

A data frame containing the summarized results in a wider format.

Examples


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_summary <- check_matching2wider(
  baseline.longer = baseline,
  intervention.arm = TRT)

baseline_summary



MAICtools documentation built on April 4, 2025, 12:17 a.m.