[R] Multiple imputation and matching

moleps moleps2 at gmail.com
Fri Aug 20 18:25:18 CEST 2010


Dear all,

Is it possible to impute a dataset and create a summary table with summary from Hmisc and convert it to latex? I´m mostly familiar with cem and amelia hence the example from the documentation in cem. The imbalance command is not exactly what I was looking for...

library (cem)

if(require(Amelia)){
 data(LL)
 n <- dim(LL)[1]
 k <- dim(LL)[2]

 set.seed(123)

 LL1 <- LL
 idx <- sample(1:n, .3*n)
 invisible(sapply(idx, function(x) LL1[x,sample(2:k,1)] <<- NA))

 imputed <- amelia(LL1,noms=c("black","hispanic","treated","married",
                              "nodegree","u74","u75")) 
 imputed <- imputed$imputations[1:5]

##Here I´d like to produce a table

 mat1 <- cem("treated", datalist=imputed, drop="re78")
 mat1

## here I´d like to produce a table with the matched elements.

Regards,

M



More information about the R-help mailing list