Hi Erik,
Yeah, that's a feature of the xt suite of commands---the weights have to be
constant within units. One way to handle this is to match at the level of
the unit (and only match on unit-level covariates) and then use those
weights. You could also simply drop units with 0 weight and accept a little
imbalance due to the weights being off. Or you could use a binary treatment
and use a k2k matching solution.
Hope that helps!
Cheers,
Matt
~~~~~~~~~~~
Matthew Blackwell
Assistant Professor of Government
Harvard University
url:
On Wed, Nov 11, 2015 at 5:44 PM, Erik Cleven <erikcleven(a)gmail.com> wrote:
I got the weights calculated but am running a negative
binomial regression
with the units being country-years. It said pweights not allowed with fixed
and random effects models, so I substitued iweight. When I run the xtnbreg
I get the message that weight must be constant within country.
On Wed, Nov 11, 2015 at 4:59 PM, Ariel Linden <ariel.linden(a)gmail.com>
wrote:
Sorry, I did not see your last line.
Yes, create a single variable that is categorical. Again, here is the
continuation of my example:
. regress y i.ord_treat [pw= cem_weights]
. margins ord_treat, pwcompare(effects) mcompare(bonferroni)
So here I have run a regression in which the outcome Y is continuous, and
treatment is a categorical variable called “ord_treat”
I then run margins to get all pairwise comparisons with Bonferroni
adjustment for multiple tests
Ariel
*From:* cem-bounces(a)lists.gking.harvard.edu [mailto:
cem-bounces(a)lists.gking.harvard.edu] *On Behalf Of *Erik Cleven
*Sent:* Wednesday, November 11, 2015 4:21 PM
*Cc:* cem(a)lists.gking.harvard.edu
*Subject:* Re: [cem] cem error message
Thanks, Ariel!
Because of the error message cem does not calculate cem_weights. I am
therefore not able to run a regression model after cem preprocessing the
data.
I assume that when you have more than two treatments is it correct to use
one treatment variable that is coded as a categorical variable, right?
Erik
On Wed, Nov 11, 2015 at 4:06 PM, Ariel Linden <ariel.linden(a)gmail.com>
wrote:
You can certainly specify more than 2 treatments. The error you’re
getting is because –imbalance- is set up to compare between only two
treatment groups. As for the k2k error, I don’t get that error. However, I
do find that k2k does not produce 1:1 matches when there are more than two
treatments.
*From:* cem-bounces(a)lists.gking.harvard.edu [mailto:
cem-bounces(a)lists.gking.harvard.edu] *On Behalf Of *Erik Cleven
*Sent:* Wednesday, November 11, 2015 3:59 PM
*To:* cem(a)lists.gking.harvard.edu
*Subject:* [cem] cem error message
I am attempting to run cem with an ordinal treatment variable that has
four values. I get the following error message:
imbalance(): 3258 <tmp>[1,1] found where void required
<istmt>: - function returned error
r(3258);
A previous reply to someone who also got this error message said to
update cem because there was a bug with the imb function.
I updated and now recieve this message:
NOTE: Treatment has must have only 2 levels to compute distance and
weights. In addition, k2k cannot be used.
Does this mean cem cannot be used with more than 2 treatments? Actually I
have a continuous treatment but I recoded it to a variable with four
levels.
Thanks!
Erik
--
Erik Cleven, PhD
Assistant Professor
Department of Politics
Saint Anselm College
100 Saint Anselm Drive
Manchester, NH 03102-1310
E-mail: ecleven(a)anselm.edu
Office Phone: (603) 222-4119
Cell phone: (603) 867-8732
-
--
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
--
Erik Cleven, PhD
Assistant Professor
Department of Politics
Saint Anselm College
100 Saint Anselm Drive
Manchester, NH 03102-1310
E-mail: ecleven(a)anselm.edu
Office Phone: (603) 222-4119
Cell phone: (603) 867-8732
--
Erik Cleven, PhD
Assistant Professor
Department of Politics
Saint Anselm College
100 Saint Anselm Drive
Manchester, NH 03102-1310
E-mail: ecleven(a)anselm.edu
Office Phone: (603) 222-4119
Cell phone: (603) 867-8732
-
--
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