rollmatch (version 1.0.0)

makeOutput: Combine the results of rollmatch into a tidy list for output As it's an internal helper function to aid in testing, it is not exported for use outside of the package.

Description

Combine the results of rollmatch into a tidy list for output As it's an internal helper function to aid in testing, it is not exported for use outside of the package.

Usage

makeOutput(pred_model, lr_result, data_full, matches, orig.call, formula, tm,
  entry, lookback)

Arguments

pred_model

The propensity scoring model create in runModel

lr_result

The dataset given to runModel with the additional of the score values generated by the propensity score model

data_full

The original data provided with the additional of control weights

matches

Dataframe containing the matches from comparison_pool

orig.call

The original call of the main function

formula

Original formula used

tm

The time period indicator.

entry

The time period in which the participant enrolled in the intervention (in the same units as the tm variable).

lookback

The number of time periods to look back before the time period of enrollment (1-10).

Value

output returns a list containing the following components:

call

The original rollmatch call.

model

The output of the model used to estimate the distance measure.

scores

The propensity score and logit of the propensity score.

data

The original dataset with matches, scores, and weights applied.

summary

A basic summary table.

ids_not_matched

A vector of unmatched treatment ids

total_not_matched

The count of unmatched treatment ids

Examples

Run this code
# NOT RUN {
orig.call <- "Ignore"
formula <- as.formula(treat ~ qtr_pmt + yr_pmt + age + is_male + is_white +
                       is_disabled + is_esrd + months_dual + chron_num + lq_ed +
                       yr_ed2 + lq_ip + yr_ip2)
tm <- "quarter"; entry <- "entry_q"; lookback <- 1
load(url(paste0("https://github.com/RTIInternational/rollmatch/raw/master/",
                "tests/testthat/output.rda")))
pred_model <- output$pred_model
lr_result <- output$lr_result
load(url(paste0("https://github.com/RTIInternational/rollmatch/raw/master/",
                "tests/testthat/out_list.rda")))
data_full <- out_list$data_full
matches <- out_list$matches
out <- makeOutput(pred_model, lr_result, data_full, matches, orig.call,
                  formula, tm, entry, lookback)
head(out)
# }
# NOT RUN {
# }

Run the code above in your browser using DataCamp Workspace