rollmatch (version 1.0.0)

createWeights: Create control weights for matches dataset, and final data output As it's an internal helper function to aid in testing, it is not exported for use outside of the package.

Description

Create control weights for matches dataset, and final data output As it's an internal helper function to aid in testing, it is not exported for use outside of the package.

Usage

createWeights(matches, data, id)

Arguments

matches

Dataframe containing the matches from comparison_pool

data

The original data provided for the function.

id

The individual id variable.

Value

A list containing two Dataframes. Matches - an updated dataset with control weights added, and data_full an updated version of the original data with weights added.

Examples

Run this code
# NOT RUN {
id <- "indiv_id"
data(package="rollmatch", "rem_synthdata")
load(url(paste0("https://github.com/RTIInternational/rollmatch/raw/master/",
                "tests/testthat/matches.rda")))
data <- rem_synthdata
matches <- addMatchesColumns(matches)
out_list <- createWeights(matches, data, id)
head(a)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab