rollmatch (version 1.0.0)

trimPool: Caliper to trim the comparison data to only observations within threshold As it's an internal helper function to aid in testing, it is not exported for use outside of the package.

Description

Caliper to trim the comparison data to only observations within threshold As it's an internal helper function to aid in testing, it is not exported for use outside of the package.

Usage

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

Arguments

caliper

The pre-specified distance within which to allow matching. The caliper width is calculated as the caliper 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 caliper 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(caliper = .2, data_pool = comparison_pool,
                         lr_result = lr_result)
head(trimmed_poll)
# }
# NOT RUN {
                         
# }

Run the code above in your browser using DataLab