pairmatch()
or fullmatch()
can determine optimal matches.pscore.dist(glmobject, structure.fmla = NULL, standardization.scale=sd)
glm()
or, say, bayesglm
(from package
brglm()
(from the sd<
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 distances are
differences of the linear predictor from the propensity model, rather than
differences of estimated probabilities, avoiding compression of
estimated propensities near 0 and 1 (Rosenbaum and Rubin, 1985). They will
have been scaled by the pooled SD of propensity scores in the
treatment and control groups, so that a caliper of .25 pooled SDs on
the propensity score can be coded as value/(value<=.25)< code="">; see
the examples.
The list also carries some metadata as attributes, data that are not of direct interest to
the user but are useful to
fullmatch()
and pairmatch()
.=.25)<>
glmobject
need not necessarily be the result of a call to
glm
. It should be a list with elements: y
, a vector that
is positive for treatment subjects and nonpositive for controls;
linear.predictors
, containing the propensity scores; and
data
, the data frame from which propensities were made.
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 these subclasses; the
same variables should also have appeared on the RHS of the formula
used to specify the propensity model. This is a wrapper to makedist
, so it keeps track of
metadata useful for matching, as described on the help page for that function.
makedist
, mahal.dist
, fullmatch
, pairmatch
,
caliper
data(nuclearplants)
psm <- glm(pr~.-(pr+cost), family=binomial(), data=nuclearplants)
psd <- pscore.dist(psm)
fullmatch(psd)
fullmatch(caliper(.25, psd)) # Propensity matching with calipers
Run the code above in your browser using DataLab