rollmatch (version 1.0.1)

trimPool: Use a caliper to trim the comparison data to only observations within threshold

Description

Use a caliper to trim the comparison data to only observations within threshold

Usage

trimPool(alpha, data_pool, lr_result, weighted_pooled_stdev = FALSE)

Arguments

alpha

The pre-specified distance within which to allow matching. The caliper width is calculated as the alpha multiplied by the pooled standard deviation of the propensity scores or the logit of the propensity scores - depending on the value of match_on.

lr_result

Dataframe of results from model in runModel.

weighted_pooled_stdev

Boolean. FALSE for average pooled standard deviation and TRUE for weighted pooled standard deviation.

dataPool

Dataframe of comparison data to be trimmed.

Value

Dataframe of the trimmed comparisons based on the alpha value

Examples

Run this code
# NOT RUN {
load(url(paste0("https://github.com/RTIInternational/rollmatch/raw/master/",
                 "tests/testthat/lr_result.rda")))
load(url(paste0("https://github.com/RTIInternational/rollmatch/raw/master/",
                "tests/testthat/comparison_pool.rda")))
trimmed_pool <- trimPool(alpha = .2, data_pool = comparison_pool,
                         lr_result = lr_result)
head(trimmed_poll)
# }
# NOT RUN {
                         
# }

Run the code above in your browser using DataLab