match_case: Selected controls matching a list of variables from a case

Description Usage Arguments Value

View source: R/matching.R

Description

Helper function for get_matches() This function wil perform incidence density sampling or exact sampling up to a supplied number of matched controls

Usage

1
match_case(matcher, control_pool, n_controls, id, replace)

Arguments

matcher

list of character strings defining the matching conditions

control_pool

dataframe of potential controls for matching

n_controls

The number of controls for each case. If replace == FALSE this is a maximum value

id

named vector of length 1 for the variable name and value of the case identifier

replace

logical should sampling of matched controls be with replacement (incident density sampling) or not.

Value

A dataframe of matched controls or NULL if no controls could be found


rOpenHealth/rEHR documentation built on March 19, 2018, 7:58 a.m.