rollmatch (version 1.0.0)

createMatches: Algorithm to find best matches from the comparison pool As it's an internal helper function to aid in testing, it is not exported for use outside of the package.

Description

Algorithm to find best matches from the comparison pool As it's an internal helper function to aid in testing, it is not exported for use outside of the package.

Usage

createMatches(trimmed_pool, num_matches = 3, replacement = TRUE)

Arguments

num_matches

Integer. the number of comparison beneficiary matches to attempt to assign to each treatment beneficiary

replacement

Boolean. Assign comparison beneficiaries with replacement (TRUE) or without replacement (FALSE). If replacement is TRUE, then comparison beneficiaries will be allowed to be used with replacement within a single quarter, but will be allowed to match to different treatment beneficiaries across multiple quarters.

comparison_pool

Dataframe containing the pool from which matches should be found

Value

Dataframe containing top matches

Examples

Run this code
# NOT RUN {
num_matches <- 3; replacement <- TRUE
load(url(paste0("https://github.com/RTIInternational/rollmatch/raw/master/",
                "tests/testthat/trimmed_pool.rda")))
matches <- createMatches(trimmed_pool, num_matches, replacement)
head(matches)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab