Skip to content
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

Open
clandinq opened this issue Jun 5, 2024 · 1 comment
Open

Impossible to reconstruct the matched dataset #4

clandinq opened this issue Jun 5, 2024 · 1 comment

Comments

@clandinq
Copy link

clandinq commented Jun 5, 2024

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 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 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()
@JasjeetSekhon
Copy link
Owner

JasjeetSekhon commented Jun 5, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants