Hi,
I am glad you could get it to work. I don't really know  I usually just
use xtable and any additional formatting I need done I do in my LaTeX
editor. Perhaps there isn't a nice tex format out of the box for MI data.
Once you write some nice code, you could keep reusing it or better yet
package it :)

On Sunday, August 18, 2013, Francesco Sarracino wrote:

> That's right!
> Your advice is in the right direction and with little adjustments it did
> the job. However, I admit it was tricky and the result looks a bit
> artisanal and needs some polishing that I will do by hand in the tex code.
> Is it possible that there is no way to get nicely latex formatted tables
> concerning multiply imputed data-set?
> But maybe I should open a separate thread on this.
> Thanks a lot for your kind and patient help.
> Best regards,
> f.
>
>
> On 18 August 2013 15:56, Christopher Desjardins 
> <cddesjard...@gmail.com<javascript:_e({}, 'cvml', 'cddesjard...@gmail.com');>
> > wrote:
>
>> Seems you're after the pooled results. Would the following work?
>>
>>
>>
>> library(Amelia)
>> library(Zelig)
>> 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(gdp_pc ~ trade + civlib, model="ls",data = imp1)
>> lm.imputed2 <- zelig(gdp_pc ~ trade + civlib, model="ls",data = imp2)
>>
>> lm1 <- as.data.frame(summary(lm.imputed1)$coef)
>> lm2 <- as.data.frame(summary(lm.imputed2)$coef)
>> lm1[,2] <- ifelse(lm1[,4]<.001,paste(lm1[,2],"***",sep=" "),
>>                   ifelse(lm1[,4]<.01,paste(lm1[,2],"**",sep=" "),
>>                          ifelse(lm1[,4]<.05,paste(lm1[,2],"*",sep=" "),
>>                                 ifelse(lm1[,4]<.1,paste(lm1[,2],".",sep="
>> "),lm1[,2]))))
>>
>> lm2[,2] <- ifelse(lm2[,4]<.001,paste(lm2[,2],"***",sep=" "),
>>                   ifelse(lm2[,4]<.01,paste(lm2[,2],"**",sep=" "),
>>                          ifelse(lm2[,4]<.05,paste(lm2[,2],"*",sep=" "),
>>                                 ifelse(lm2[,4]<.1,paste(lm2[,2],".",sep="
>> "),lm2[,2]))))
>>
>> ## ONE OPTIONS ##
>> lms <- as.data.frame(cbind(lm1[,1],lm2[,1],lm1[,2],lm2[,2]))
>> rownames(lms) <- rownames(lm1)
>> colnames(lms) <- c("Imp1.Est","Imp2.Est","Imp1.SE","Imp2.SE")
>> xtable(lms)
>>
>> ## OR ##
>> xtable(cbind(lm1[,1:2],lm2[,1:2]))
>>
>
>
>
> --
> Francesco Sarracino, Ph.D.
> fsarracino <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