matchReport: matchReport - report of matching from incidenceMatch and...

View source: R/matchReport.R

matchReportR Documentation

matchReport - report of matching from incidenceMatch and exposureMatch

Description

The function provides very simple tables of the success of finding controls and the reuse of cases and controls. Designed to deal with the results of function riskSetMatch

Usage

matchReport(x)

Arguments

x

result of exposureMatch or incidenceMatch

Details

This function can be helpful to reevaluate matching options after exact matching. If many cases do not find controls it may be desirable to reduce the number of matching terms or to do further rounding of continuous matching variables.

Author(s)

Christian Torp-Pedersen & Thomas Alexander Gerds

See Also

incidenceMatch exposureMatch

Examples

require(data.table)
case <- c(rep(0,40),rep(1,15)) 
ptid <- paste0("P",1:55)
sex <- c(rep("fem",20),rep("mal",20),rep("fem",8),rep("mal",7))
byear <- c(rep(c(2020,2030),20),rep(2020,7),rep(2030,8))
caseIndex <- c(seq(1,40,1),seq(5,47,3))
controlIndex <- caseIndex
library(data.table)
dat <- data.table(ptid,case,sex,byear,caseIndex,controlIndex)
# Very simple match without reuse - no dates to control for
matched.data <- incidenceMatch(ptid="ptid",event="case",terms=c("byear","sex"),
data=dat,n.controls=2,
case.index="caseIndex",end.followup="controlIndex")
matchReport(matched.data)

tagteam/heaven documentation built on April 26, 2024, 6:22 a.m.