match_cov: Match

View source: R/match_cov.R

match_covR Documentation

Match

Description

Match

Usage

match_cov(dt, match)

Arguments

dt

a list of matrix

match

A vector of covariates name to match on

Value

a list of matrix containing matched cohort information

Examples

# match internal and external trial data using different covariates
smp = set_n(ssC = 140, ssE = 275, ssExt = 100)
covset1 = set_cov(n_cat = 2, n_cont = 0, mu_int = 0, mu_ext = 0, var = 1)
covset2 = set_cov(n_cat = 0, n_cont = 1, mu_int = 62, mu_ext = 65, var = 11)
cObj = c(covset1, covset2)
sample_cov <-
  simu_cov(ssObj = smp, covObj = cObj, HR = 1, driftHR = 1.2, nsim = 2)

# match on covariates 1 and 2
match_cov(dt = sample_cov, match = c("cov1", "cov2"))

# match on all 3 covariates
match_cov(dt = sample_cov, match = c("cov1", "cov2", "cov3"))


psborrow documentation built on March 7, 2023, 8:32 p.m.