-
Notifications
You must be signed in to change notification settings - Fork 43
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
optimal method with exact matching on some variables #60
Comments
I'm looking into this. Could you provide the full dataset so I can investigate? On the datasets I have It seems to be working correctly. When you run |
Thanks so much!
I attached the dataset.
I did not find the Std. Pair Diff. in the summary you mentioned.
Please let me know.
…On Fri, Feb 26, 2021 at 3:31 PM Noah Greifer ***@***.***> wrote:
I'm looking into this. Could you provide the full dataset so I can
investigate? On the datasets I have It seems to be working correctly. When
you run summary(match), is the Std. Pair Diff. value for AGE different
from 0?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#60 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AS733LGC2AYXXVQX4WUROE3TBAAIZANCNFSM4YHRI6NQ>
.
|
Sorry, I don't see the dataset anywhere. |
I attached it in the email reply. Let me try to attach here. |
Thank you for sending the dataset. It seems like you're using an old version of Please make sure you are always using the most updated version of a package. In the future, if you think you have found a bug or unexpected behavior, it may have already been fixed in an updated version, saving you and the maintainers time. |
I see. I reinstalled Matchit(). It did solve the problem. Thank you so much!
Lesson learned.
…On Fri, Feb 26, 2021 at 10:07 PM Noah Greifer ***@***.***> wrote:
Thank you for sending the dataset. It seems like you're using an old
version of MatchIt. I was able to replicate your results using version
3.0.2, but not using version 4.0.0 or above. In recent versions, the units
are correctly matched. Please update MatchIt and this should be fixed.
Please make sure you are always using the most updated version of a
package. In the future, if you think you have found a bug or unexpected
behavior, it may have already been fixed in an updated version, saving you
and the maintainers time.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#60 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AS733LD4TP6UXGXIL3S6WD3TBBOYNANCNFSM4YHRI6NQ>
.
|
I used the
method = “exact”
option to force exact matching on some variables and used other methods for the other variables.The
method = “nearest”
approach worked as expected. However, when I tried switching the argument tomethod = “optimal”
, it seems the matching id output bymatch.matrix
do not show the expected matching for the variables specified in the exact option. Why is it so?You can see in the output, subject 2 and subject 25 who are matched do not have the same age.
Code I used:
match= matchit(A ~ SEX + AGE + V1 + V2, method = "optimal",
exact = c("SEX", "AGE"), data = data_test)
match_id<-match$match.matrix
N<-9
match_id2<-c(1:N, match_id)
match_data<-match.data(match)
#reorder matched control in the same order as treated
match_data2<-match_data[match_id2, ]
match_data2$match_id<-rep(1:N, 2)
Output:
The text was updated successfully, but these errors were encountered: