-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Impossible to reconstruct the matched dataset #4
Comments
In your example,
mat = cbind(rr1[["index.treated"]], rr1[["index.control"]], rr1$weights)
That is the matched dataset.
See the help page for the weights variable.
By default, one is matching with replacement (as in Abadie and Imbens).
…On Tue, Jun 4, 2024 at 9:12 PM César Landín ***@***.***> wrote:
I ran into this package looking for an alternative to the package MatchIt,
which cannot generate the matching estimator developed by Abadie and Imbens
and therefore does not estimate the ATE for nearest neighbor matching. I
have been trying to understand which observations from the original dataset
are kept in the matched dataset. Two different methods have not worked out
for me:
1.
Using the mdata object
- The Matching manual
<https://cran.r-project.org/web/packages/Matching/Matching.pdf>
describes that mdata is a list containing the matched datasets
produced by Match. However, these vectors or matrices do not correspond to
either the original sample size or the matched dataset size (e.g. obtained
by looking at the dimension of the weights.
2.
Generating the matched dataset from index.treated and index.control.
-
The accompanying paper
<https://www.jstatsoft.org/article/view/v042i07> says that
the index.control and index.treated indices which are in the object
returned by Match are vectors containing the observation numbers from the
original dataset for the treated (control) observations in the matched
dataset. Both indices together can be used to construct the matched
dataset. The matched dataset is also returned in the mdata object—see the
Match manual page for details.
-
However, when adding these two vectors together and keeping unique
values I get a value that is different from the size of the weights
object. Then the matched dataset cannot be reconstructed.
Here is a minimal working example:
library("Matching")
library("dplyr")
data("lalonde")
Y <- lalonde$re78
Tr <- lalonde$treat
glm1 <- glm(Tr ~ age + educ + black + hisp + married + nodegr + re74 + re75, family = binomial, data = lalonde)
rr1 <- Match(Y = Y, Tr = Tr, X = glm1$fitted)
c(rr1[["index.treated"]], rr1[["index.control"]]) %>% unique() %>% length()
—
Reply to this email directly, view it on GitHub
<#4>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADHXHIOOYGEQAX2BOCN6ND3ZFZQXXAVCNFSM6AAAAABIZWQVXGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGMZTINRYGY2DIOA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I ran into this package looking for an alternative to the package MatchIt, which cannot generate the matching estimator developed by Abadie and Imbens and therefore does not estimate the ATE for nearest neighbor matching. I have been trying to understand which observations from the original dataset are kept in the matched dataset. Two different methods have not worked out for me:
Using the mdata object
mdata
is a list containing the matched datasets produced by Match. However, these vectors or matrices do not correspond to either the original sample size or the matched dataset size (e.g. obtained by looking at the dimension of theweights
.Generating the matched dataset from
index.treated
andindex.control
.The accompanying paper says that
However, when adding these two vectors together and keeping unique values I get a value that is different from the size of the
weights
object. Then the matched dataset cannot be reconstructed.Here is a minimal working example:
The text was updated successfully, but these errors were encountered: