Displaying 1 result from an estimated 1 matches for "multipledataset".
2007 May 10
0
Need help imputing missing data using mice and outputting them
...issing data and output the results of the imputation.
My data set is called: MyData.
I have a bunch of variables all of which start with Q20_ - and some of them have missing values.
Here is what I've been doing:
imputationmodel<-mice( MyData[ c (grep("Q20_", names(MyData)) ) ] )
multipledataset<-complete(imputationmodel,action="long")
write.table(as.data.frame(lapply(multipledataset,function(x) {as.numeric(is.element(x,5))} )), sep="\t",file="multiset.txt",row.names=F)
The last line (write.table) makes it so that all the values get changed into 0s and 1s...