Hi Dennis,
We need to implement an "if" syntax for the imbalance command, but it's
still a work in progress. For now, you can simply subset the data to
non-missing treatments:
drop if approach1 != .
That should solve the error.
Cheers,
Matt
~~~~~~~~~~~
Matthew Blackwell
Assistant Professor of Government
Harvard University
url:
On Thu, Jul 24, 2014 at 9:09 PM, Ariel Linden <ariel.linden(a)gmail.com>
wrote:
So the matching worked, just not –imbalance- … I’ll
have to Let Matt
Blackwell field this error.
*From:* Dennis Hanseman [mailto:hanseman@one.net]
*Sent:* Thursday, July 24, 2014 8:51 PM
*To:* 'Ariel Linden'; cem(a)lists.gking.harvard.edu
*Subject:* RE: [cem] Error when using cem with >2 treatments
Tried that, but got the error message again:
. cem margins1 age if approach1 != . , tr(approach1)
Matching Summary:
-----------------
Number of strata: 28
Number of matched strata: 24
1 2 3
All 457 6352 2444
Matched 457 6292 2427
Unmatched 0 60 17
imbalance(): 3258 <tmp>[1,1] found where void required
<istmt>: - function returned error
r(3258);
Dennis
*From:* Ariel Linden [mailto:ariel.linden@gmail.com
<ariel.linden(a)gmail.com>]
*Sent:* Thursday, July 24, 2014 8:09 PM
*To:* Dennis Hanseman; cem(a)lists.gking.harvard.edu
*Subject:* Re: [cem] Error when using cem with >2 treatments
Your "if" statement needs to come before the comma
Ariel
*From: *Dennis Hanseman
*Sent: *Thursday, July 24, 2014 8:01 PM
*To: *cem(a)lists.gking.harvard.edu
*Subject: *[cem] Error when using cem with >2 treatments
I’m trying to use cem to do matching involving 3 treatments. Prof. King (
http://comments.gmane.org/gmane.comp.lang.r.matchit/393) indicated that
this can be done.
When I tried it, I got an error message –
imbalance(): 3258 <tmp>[1,1] found where void required
<istmt>: - function returned error
There was a discussion on this site on July 24 of 2013 about a similar issue. In that
case, there were only 2 treatments but a treatment of “.”, along with “1” and “2”, showed
up in the summary table. The suggestion was to add “if indepvote != ." to the cem
call.”
While I’m sure that there are no missing values of my treatment variable, I still tried
to add the if clause to my cem call. But it didn’t help. I got another error:
. cem margins1 age, tr(approach1) if approach1 != .
option if not allowed
r(198);
Any ideas of how I can proceed?
Thanks.
Dennis Hanseman
-
--
cem Mailing List, served by HUIT
Send messages: cem(a)lists.gking.harvard.edu
[un]subscribe Options:
http://lists.gking.harvard.edu/?info=cem
More information on cem:
http://gking.harvard.edu/cem
Cem mailing list
Cem(a)lists.gking.harvard.edu
To unsubscribe from this list or get other information:
https://lists.gking.harvard.edu/mailman/listinfo/cem