pscore.dist {optmatch} | R Documentation |
Extracts scores from a fitted propensity scoring model,
assembling them into a discrepancy matrix (or matrices) from which
pairmatch()
or fullmatch()
can determine optimal matches.
pscore.dist(glmobject, structure.fmla = NULL)
glmobject |
A fitted propensity modeling object, produced by a
call to glm() or, say, brlr() from the package of the
same name. |
structure.fmla |
Optional formula argument specifying subclasses within which matches are to be performed. If omitted, no subclassification is done. If it is given, the RHS of this formula gives variables on which to stratify the sample prior to matching. |
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.
Object of class 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)
; 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()
.
Ben B. Hansen
P.~R. Rosenbaum and D.~B. Rubin (1985), ‘Constructing a control group using multivariate matched sampling methods that incorporate the propensity score’, The American Statistician, 39 33–38.
makedist
, mahal.dist
, fullmatch
, pairmatch
data(nuclearplants) psm <- glm(pr~.-(pr+cost), family=binomial(), data=nuclearplants) psd <- pscore.dist(psm) fullmatch(psd) fullmatch(psd/(psd<.25)) # Propensity matching with calipers