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]))

        [[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