matchReport | R Documentation |
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
matchReport(x)
x |
result of exposureMatch or incidenceMatch |
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.
Christian Torp-Pedersen & Thomas Alexander Gerds
incidenceMatch exposureMatch
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.