I think that the problem is you have "ratio = 2". optimal matching may not work
with that option.
Kosuke
Department of Politics
Princeton University
On Aug 14, 2013, at 10:03 AM, Sharon Simonton <simonton(a)umich.edu> wrote:
Dear Liz,
Thanks so much! I'll go ask our IT admin what an R GUI is.
Code in the manual won't work for me. Thank you for the tip.
~ Sharon
On Tue, Aug 13, 2013 at 9:38 PM, Stuart, Elizabeth A. <estuart(a)jhsph.edu> wrote:
Hi Sharon,
You can still call optmatch from MatchIt to run optimal matching; just ignore that
warning. (See sample code and output below).
It sounds like you're running it from within an R GUI, which may cause trouble with
optmatch; I'm not sure. But I was able to get the code below to run fine.
Thanks,
Liz
library(MatchIt)
Loading required package:
MASS
##
## MatchIt (Version 2.4-20, built: 2011-10-24)
## Please refer to
http://gking.harvard.edu/matchit for full documentation
## or help.matchit() for help with commands supported by MatchIt.
##
data(lalonde)
m.out <- matchit(treat ~ age + educ + re74 + re75, data=lalonde,
method="optimal")
Loading required package: optmatch
...
Warning message:
In fullmatch(d, min.controls = ratio, max.controls = ratio, omit.fraction = (n0 - :
Without 'data' argument the order of the match is not guaranteed
to be the same as your original data.
summary(m.out)
Call:
matchit(formula = treat ~ age + educ + re74 + re75, data = lalonde,
method = "optimal")
Summary of balance for all data:
Means Treated Means Control SD Control Mean Diff eQQ Med eQQ Mean eQQ Max
distance 0.3536 0.2788 0.1256 0.0748 0.0595 0.0762 0.1803
age 25.8162 28.0303 10.7867 -2.2141 1.0000 3.2649 10.0000
educ 10.3459 10.2354 2.8552 0.1105 1.0000 0.7027 4.0000
re74 2095.5737 5619.2365 6788.7508 -3523.6628 2425.5720 3620.9240 9216.5000
re75 1532.0553 2466.4844 3291.9962 -934.4291 981.0968 1060.6582 6795.0100
Summary of balance for matched data:
Means Treated Means Control SD Control Mean Diff eQQ Med eQQ Mean eQQ Max
distance 0.3536 0.3533 0.0900 0.0002 0.0008 0.0011 0.0092
age 25.8162 25.2378 10.5849 0.5784 3.0000 3.3892 9.0000
educ 10.3459 10.3189 2.5002 0.0270 0.0000 0.3838 3.0000
re74 2095.5737 1976.7943 4345.6285 118.7794 0.0000 326.5601 9177.7500
re75 1532.0553 994.4032 2047.4555 537.6521 42.9677 598.6831 8578.7470
Percent Balance Improvement:
Mean Diff. eQQ Med eQQ Mean eQQ Max
distance 99.6836 98.6167 98.5118 94.8881
age 73.8773 -200.0000 -3.8079 10.0000
educ 75.5444 100.0000 45.3846 25.0000
re74 96.6291 100.0000 90.9813 0.4204
re75 42.4620 95.6204 43.5555 -26.2507
Sample sizes:
Control Treated
All 429 185
Matched 185 185
Unmatched 244 0
Discarded 0 0
On Aug 13, 2013, at 6:33 PM, Sharon Simonton <simonton(a)umich.edu> wrote:
> Dear Liz and other MatchIt authors/users,
> Ajay chanced upon the same issue that I've been having. Is there any way to call
optimal matching using MatchIt? Every time I try to use the syntax example in the manual
and the lalonde data set, I get the message Ajay noted or R crashes with the message: R
for Windows GUI front-end has stopped working. Have updates to Optmatch made it impossible
to do optimal matching within MatchIt? I also tried to incorporate the arguments in the
warning---but to no avail. Thank you for your help.
>
>
>
>
>
> On Mon, Aug 12, 2013 at 9:47 PM, Stuart, Elizabeth A. <estuart(a)jhsph.edu>
wrote:
> No, that is a warning that optmatch started putting out after one of its updates but
you can ignore it when calling full matching using matchit.
>
> Liz
>
> On Aug 12, 2013, at 12:11 PM, Ajay Shah <ajayshah(a)mayin.org> wrote:
>
>>
library(MatchIt)
>> Loading
required package: MASS
>> > m.out <- matchit(treat ~ re74 + re75 + age + educ, data = lalonde,
>> + method = "optimal", ratio = 2)
>> Warning message:
>> In fullmatch(d, min.controls = ratio, max.controls = ratio, omit.fraction = (n0 -
:
>> Without 'data' argument the order of the match is not guaranteed
>> to be the same as your original data.
>>
>> Is there a problem here?
>>
>> --
>> Ajay Shah
>> ajayshah(a)mayin.org
>>
http://www.mayin.org/ajayshah
>>
http://ajayshahblog.blogspot.com
>> -
>> ---
>> MatchIt mailing list served by HUIT
>> List Address: matchit(a)lists.gking.harvard.edu
>> Subscribe/Unsubscribe:
http://lists.gking.harvard.edu/mailman/listinfo/ei
>> MatchIt Software and Documentation:
http://gking.harvard.edu/matchit/
>> Browse/Search List Archive:
http://lists.gking.harvard.edu/mailman/private/matchit/
>> Matchit mailing list
>> Matchit(a)lists.gking.harvard.edu
>>
>> To unsubscribe from this list or get other information:
>>
>>
https://lists.gking.harvard.edu/mailman/listinfo/matchit
>
>
> -
> ---
> MatchIt mailing list served by HUIT
> List Address: matchit(a)lists.gking.harvard.edu
> Subscribe/Unsubscribe:
http://lists.gking.harvard.edu/mailman/listinfo/ei
> MatchIt Software and Documentation:
http://gking.harvard.edu/matchit/
> Browse/Search List Archive:
http://lists.gking.harvard.edu/mailman/private/matchit/
> Matchit mailing list
> Matchit(a)lists.gking.harvard.edu
>
> To unsubscribe from this list or get other information:
>
>
https://lists.gking.harvard.edu/mailman/listinfo/matchit
>
-
---
MatchIt mailing list served by HUIT
List Address: matchit(a)lists.gking.harvard.edu
Subscribe/Unsubscribe:
http://lists.gking.harvard.edu/mailman/listinfo/ei
MatchIt Software and Documentation:
http://gking.harvard.edu/matchit/
Browse/Search List Archive:
http://lists.gking.harvard.edu/mailman/private/matchit/
Matchit mailing list
Matchit(a)lists.gking.harvard.edu
To unsubscribe from this list or get other information:
https://lists.gking.harvard.edu/mailman/listinfo/matchit