Match
function which
separates the matching problem into subgroups defined by a factor.
This is equivalent to conducting exact matching on each factor.
Matches within each factor are found as determined by the
usual matching options. This function is much faster for large
datasets than the Match
function itself.Matchby(Y, Tr, X, by, estimand = "ATT", M = 1, exact = NULL, caliper = NULL,
Weight = 1, Weight.matrix = NULL, tolerance = 1e-05,
distance.tolerance = 1e-05, print.level=1, version="fast", ...)
as.factor(by)
defines the
grouping, or a list of such factors in which case their
interaction is used for the grouping.X
. If a logical vector is provided, a logical value should
be providX
. The default value of
1 denotes that weights are equal to the inverse of the variances. 2
denotes the MahaX
---see
the Weight
option. This square matrix should have as many
columns as the number of columns of the X
distance.tolerance
are deemed to be equal to zero. This
option can be used to perform a type of optimal Match
.Match
which was used.Matchby
is much faster for large datasets than
Match
. But Matchby
only implements a subset of
the functionality of Match
. For example, the
restrict
option cannot be used, Abadie-Imbens standard errors
are not provided and bias adjustment cannot be requested.
Matchby
is a wrapper for the Match
function which
separates the matching problem into subgroups defined by a factor. This
is the equivalent to doing exact matching on each factor, and the
way in which matches are found within each factor is determined by the
usual matching options. Sekhon, Jasjeet S. 2006. ``Alternative Balance Metrics for Bias
Reduction in Matching Methods for Causal Inference.'' Working Paper.
Abadie, Alberto and Guido Imbens. 2005.
``Large Sample Properties of Matching Estimators for Average
Treatment Effects.'' Econometrica 74(1): 235-267.
Diamond, Alexis and Jasjeet S. Sekhon. 2005. ``Genetic Matching for
Estimating Causal Effects: A General Multivariate Matching Method for
Achieving Balance in Observational Studies.'' Working Paper.
Imbens, Guido. 2004. Matching Software for Matlab and
Stata.
Match
,
summary.Matchby
,
GenMatch
,
MatchBalance
,
balanceMV
, balanceUV
,
qqstats
, ks.boot
,
GerberGreenImai
, lalonde
#
# Match exactly by racial groups and then match using the propensity score within racial groups
#
data(lalonde)
#
# Estimate the Propensity Score
#
glm1 <- glm(treat~age + I(age^2) + educ + I(educ^2) +
hisp + married + nodegr + re74 + I(re74^2) + re75 + I(re75^2) +
u74 + u75, family=binomial, data=lalonde)
#save data objects
#
X <- glm1$fitted
Y <- lalonde$re78
Tr <- lalonde$treat
# one-to-one matching with replacement (the "M=1" option) after exactly
# matching on race using the 'by' option. Estimating the treatment
# effect on the treated (the "estimand" option defaults to ATT).
rr <- Matchby(Y=Y, Tr=Tr, X=X, by=lalonde$black, M=1);
summary(rr)
Run the code above in your browser using DataLab