Learn R Programming

TriMatch (version 0.9.9)

trimatch: Creates matched triplets.

Description

Create matched triplets by minimizing the total distance between matched triplets within a specified caliper.

Usage

trimatch(tpsa, caliper = 0.25, nmatch = c(15), match.order, exact,
  method = maximumTreat, ...)

Arguments

tpsa

the results from trips

caliper

a vector of length one or three indicating the caliper to use for matching within each step. This is expressed in standardized units such that .25 means that matches must be within .25 of one standard deviation to be kept, otherwise the match is dropped.

nmatch

number of closest matches to retain before moving to next edge. This can be Inf in which case all matches within the caliper will be retained through to the next step. For large datasets, evaluating all possible matches within the caliper could be time consuming.

match.order

character vector of length three indicating the order in which the matching algorithm will processes. The default is to use start with the group the middle number of subjects, followed by the smallest, and then the largest.

exact

a vector or data frame of representing covariates for exact matching. That is, matched triplets will first be matched exactly on these covariates before evaluating distances.

method

This is a function that specifies which matched triplets will be retained. If NULL, all matched triplets within the specified caliper will be returned (equivalent to caliper matching in two group matching). The default is maximumTreat that attempts include each treatment at least once. Another option is OneToN which mimicks the one-to-n matching where treatments are matched to multiple control units.

...

other parameters passed to method.

Details

The trips function will estimate the propensity scores for three models. This method will then find the best matched triplets based upon minimizing the summed differences between propensity scores across the three models. That is, the algorithm works as follows:

  • The first subject from model 1 is selected.

  • The nmatch[1] smallest distances are selected using propensity scores from model 1.

  • For each of the matches identified, the subjects propensity score from model 2 is retrieved.

  • The nmatch[2] smallest distances are selected using propensity score from model 3.

  • For each of those matches identified, the subjects propensity score from model 2 is retrieved.

  • The distances is calculated from the first and last subjects propensity scores from model 2.

  • The three distances are summed.

  • The triplet with the smallest overall distance is selected and returned.

Examples

Run this code
# NOT RUN {
data(turoing)
formu <- ~ Gender + Ethnicity + Military + ESL + EdMother + EdFather + Age +
     Employment + Income + Transfer + GPA
tpsa <- trips(tutoring, tutoring$treat, formu)
tmatch <- trimatch(tpsa, status=FALSE)
# }

Run the code above in your browser using DataLab