Hi Mitch,
The better way to go here probably is to export a "long" Stata file from
Amelia using the following command:
write.amelia(a.out, separate = FALSE, file.stem = "outdata", format =
"eta")
With this, you can import the data as imputed in Stata and use cem in stata
with the impvar argument:
mi import flong, m(imp) id(myidvar) imp(var1-varK)
cem gender n3(0 6.5 7.5 8.5) black knowledge(0 0.15 0.45 1.5)
cem_partyid(#0) cem_id eo(#0), tr(treated) impvar(imp)
Hope that helps!
Cheers,
matt.
~~~~~~~~~~~
Matthew Blackwell
Assistant Professor of Political Science
University of Rochester
url:
http://www.mattblackwell.org
On Thu, Apr 18, 2013 at 5:41 PM, NICOLASWoody <woodynicolas(a)msn.com> wrote:
Hi Cem list,
I came across a problem when I tried to use the "miest" command to fit a
regression model on the five imputed data sets generated by Amelia II
because the variable "cem_weight" was not found in other four imputed data
sets except the first one.
I used the Amelia II to produce five imputed data sets and saved them as:
imp1.dta, imp2.dta, imp3.dta, imp4.dta, imp5.dta in the same folder. I then
opened imp1.dta and matched the data with "cem" command. After that, I used
the "miest" command to do the regression. However, there was an error and
it showed that "no; data in memory would be lost". I learned to use
"miest"
from the manual cem: Coarsened Exact Matching in Stata written by Blackwell
et al. (2010). In the manual, on page 15, it says that "the cem_weights
variable is added to each of the datasets". Except for imp1.dta, I did not
find the variable "cem_weights" in other four imputed datasets. Many thanks
for anyone who can help me solve this problem. I used Stata 12 in Windows
Vista.
The following are the commands I typed in Stata:
. use "C:\Stata12\imp1.dta", clear
(Written by R. )
. imb gender n3 black knowledge partyid ideology,tr(treated)
. cem gender n3(0 6.5 7.5 8.5) black knowledge(0 0.15 0.45 1.5)
cem_partyid(#0) cem_id
eo(#0), tr(treated) miname(imp) misets(5)
. miest imp reg supp treated wmedia [aweight=cem_weights]
no; data in memory would be lost
r(4);
Best,
Mitch
-
--
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