pairmatch() or fullmatch() can determine optimal matches.mahal.dist(distance.fmla, data, structure.fmla = NULL, inverse.cov = NULL)distance.fmla and (if
specified) structure.fmla are to be evaluated.optmatch.dlist, which is suitable to be given
as distance argument to fullmatch or
pairmatch. Specifically, a list of matrices, one for each subclass defined by the
interaction of variables appearing on the right hand side of
structure.fmla. Each of these is a number of treatments by
number of controls matrix of propensity distances.
The list also carries some metadata as attributes, data that is not of direct interest to
the user but is useful to fullmatch() and pairmatch().
The purpose of giving a structure.fmla argument is to speed
up large problems. Variables appearing on its
right-hand side will be interacted to create the subclasses. If
structure.fmla is given then its LHS is used to define
treatment and control groups (and one doesn't have to put anything on
the LHS of distance.fmla).
The function attempts to calculate the inverse covariance itself, so
ordinarily you shouldn't need to give it one. If you'll be calling
the function repeatedly, however, it may speed things up to compute
and store the inverse covariance once, rather than each time this
function is called; in that case you can save time by giving the
inverse.covariance argument.
makedist, pscore.dist, fullmatch, pairmatchif (!match('nuclear',ls(),nomatch=0)) data(nuclear, package="boot")
mahal.dist(pr~date+cost, nuclear)
mahal.dist(~date+cost, nuclear, pr~pt)Run the code above in your browser using DataLab