An exact match is one based on a factor. Within a level, all observations are allowed to be matched. An exact match can be combined with another distance matrix to create a set of matching subproblems.
1 2 3 4 5 6 7
A factor vector or a formula, used to select method.
Additional arguments for methods.
A logical or binary vector the same length as
an optional vector specifying a subset of observations to be used
A function which indicates what should happen when the data contain ‘NA’s
exactMatch creates a block diagonal matrix of 0s and
Infs. The pairs with 0 entries are within the same level of
the factor and legitimate matches.
Inf indicates units in
exactMatch replaces the
structure.fmla argument to several functions in previous
versions of optmatch. For the
factor method, the two
treatment must be the same length. The
x is interpreted as indicating the grouping factors
for the data, and the vector
treatment indicates whether a
unit is in the treatment or control groups. At least one of these
two vectors must have names. For the
formula method, the
data argument may be omitted, in which case the method
attempts to find the variables in the environment from which the
function was called. This behavior, and the arguments
na.action, mimics the behavior of
A matrix like object, which is suitable to be given as
distance argument to
pairmatch. The exact match will be only zeros and
Inf values, indicating a possible match or no possible
match, respectively. It can be added to a another distance matrix
to create a subclassed matching problem.
Mark M. Fredrickson
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
data(nuclearplants) ### First generate a standard propensity score ppty <- glm(pr~.-(pr+cost), family = binomial(), data = nuclearplants) ppty.distances <- match_on(ppty) ### Only allow matches within the partial turn key plants pt.em <- exactMatch(pr ~ pt, data = nuclearplants) as.matrix(pt.em) ### Blunt matches: match.pt.em <- fullmatch(pt.em) print(match.pt.em, grouped = TRUE) ### Combine the propensity scores with the subclasses: match.ppty.em <- fullmatch(ppty.distances + pt.em) print(match.ppty.em, grouped = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.