Dear Christopher,

I have multiply imputed two data-set (let's say Africa1 and Africa2).
Now I run 1 regression (let's call it: reg1) using the imputed data from
Africa1 and 1 regression  (let's call it: reg2) using the imputed data from
Africa2. For these 2 regressions I use Zelig that automatically takes into
account the fact that Africa1 and Africa2 are multiply imputed data-sets.
Now, my problem is to show the results of these 2 regressions in 1 latex
table where the first column contains the name of the variables, the second
column lists the coefficients (and eventually S.E. and asterisks) from reg1
and the third column lists the same information for reg2.
As I wrote, I tried the following:
reg1 <- zelig(Y ~ X + Z, model="ls",data = Africa1)
reg2 <- zelig(Y ~ X + Z, model="ls",data = Africa2)

and according to stargazer syntax I should type something like:
stargazer(reg1, reg2, summary = FALSE)
but then I get my error:
Error: Unrecognized object type.

Any ideas?
thanks,
f.


On 17 August 2013 18:41, Christopher Desjardins <cddesjard...@gmail.com>wrote:

> Oh and are you looking for just the summarized results over all the
> imputed runs? i thought you wanted them from each iteration.
>
>
>
> On Sat, Aug 17, 2013 at 11:38 AM, Christopher Desjardins <
> cddesjard...@gmail.com> wrote:
>
>> What do you mean by results? Do you want just the estimated parameters?
>> And are you looking for one big table with all the estimated parameters
>> from all imputation runs?
>>
>> Chris
>>
>>
>> On Sat, Aug 17, 2013 at 11:18 AM, Francesco Sarracino <
>> f.sarrac...@gmail.com> wrote:
>>
>>> Hi Christopher,
>>> thanks for your reply. Unfortunately, that's not what I am looking for.
>>> I would like to have a table with the results of the two models
>>> (lm.imputed1 and lm.imputed2) in two separate columns.
>>> According to stargazer syntax I should type something like:
>>> stargazer(lm.imputed1, lm.imputed2, summary = FALSE)
>>> but then I get my error:
>>> Error: Unrecognized object type.
>>>
>>>  Even though your example is insightful, I  can't  figure out how to
>>> solve my problem.
>>> Any advice is very welcome.
>>> Regards,
>>> f.
>>>
>>>
>>> On 17 August 2013 17:02, Christopher Desjardins 
>>> <cddesjard...@gmail.com>wrote:
>>>
>>>> Does this do what you want?
>>>>
>>>> library(Amelia)
>>>> library(Zelig)
>>>> library(stargazer)
>>>> library(xtable)
>>>>
>>>> data(africa)
>>>>
>>>>  m = 10
>>>> imp1 <- amelia(x = africa,cs="country",m=m)
>>>> imp2 <- amelia(x = africa,cs="country",m=m)
>>>> lm.imputed1 <- zelig(infl ~ trade + civlib, model="ls",data = imp1)
>>>> lm.imputed2 <- zelig(infl ~ trade + civlib, model="ls",data = imp2)
>>>>
>>>> # Stargazer
>>>> for(i in 1:m){
>>>>
>>>> print(stargazer(as.data.frame(summary(lm.imputed1[[i]])$coef),as.data.frame(summary(lm.imputed2[[i]])$coef)))
>>>> }
>>>>
>>>> # xtable
>>>> for(i in 1:m){
>>>>   print(xtable(summary(lm.imputed1[[i]])))
>>>>   print(xtable(summary(lm.imputed2[[i]])))
>>>> }
>>>>
>>>>
>>>> On Sat, Aug 17, 2013 at 6:37 AM, Francesco Sarracino <
>>>> f.sarrac...@gmail.com> wrote:
>>>>
>>>>> Dear listers,
>>>>>
>>>>> I am running some OLS on multiply imputed data using Amelia.
>>>>> I first imputed the data with Amelia.
>>>>> than I run a OLS using Zelig to obtain a table of results accounting
>>>>> for
>>>>> the multiply imputed data-sets. And I'd like to do this for various
>>>>> models.
>>>>> Finally, I want to output all the models in a table of results for
>>>>> latex.
>>>>>
>>>>> I've tried   with  Stargazer because it seems to support Zelig output,
>>>>> but
>>>>> when I run stargazer on a set of objects containing the output of
>>>>> zelig, I
>>>>> get the following error: Error: unrecognized object type.
>>>>>
>>>>> this message is repeated for each model I passed to Stargazer.
>>>>>
>>>>> I am sorry I can't provide a working example, because I should make up
>>>>> some
>>>>> multiply imputed data first. Hoewever, summarizing what I did is:
>>>>>
>>>>> imputed1 <- amelia(x=data1, m=10)
>>>>> imputed2 <- amelia(x=data2, m=10)
>>>>> lm.imputed1 <- zelig(Y ~ X + Z, data = imputed1)
>>>>> lm.imputed2 <- zelig(Y ~ X + Z, data = imputed2)
>>>>> stargazer(lm.imputed1, lm.imputed2)
>>>>> The outcome is the error I mentioned above.
>>>>> Thanks in advance for all the support you can offer.
>>>>> Regards,
>>>>> f.
>>>>>
>>>>>         [[alternative HTML version deleted]]
>>>>>
>>>>> ______________________________________________
>>>>> R-help@r-project.org mailing list
>>>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>>>> PLEASE do read the posting guide
>>>>> http://www.R-project.org/posting-guide.html
>>>>> and provide commented, minimal, self-contained, reproducible code.
>>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Francesco Sarracino, Ph.D.
>>> https://sites.google.com/site/fsarracino/
>>>
>>
>>
>


-- 
Francesco Sarracino, Ph.D.
https://sites.google.com/site/fsarracino/

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to