mi.completed {mi} | R Documentation |
Function to return completed data set from result of mi program.
mi.completed(object, ...) mi.matrix(object, ...) mi.data.frame(object, ...) ## S4 method for signature 'mi': mi.completed( object, m , outcome = c("data.frame", "matrix")) ## S4 method for signature 'mi': mi.matrix( object, m ) ## S4 method for signature 'mi': mi.data.frame( object, m )
object |
mi object containing a multiply imputed data set. The "mi" object is generated by the mi function. |
m |
Index of the imputed data set. The default is 1. |
outcome |
If the user wants the outcome in dataframe or matrix. |
... |
other arguments |
A data set with the missing data imputed.
Masanao Yajima yajima@stat.columbia.edu, M.Grazia Pittau grazia@stat.columbia.edu, Andrew Gelman gelman@stat.columbia.edu
Andrew Gelman and M. Grazia Pittau, A flexible program for missing-data imputation and model checking, Technical report, Columbia University, New York; Andrew Gelman and Jennifer Hill, Data Analysis Using Regression and Multilevel/Hierarchical Models, Cambridge University Press, 2007.
data(CHAIN) imp <- mi (CHAIN, n.iter=6) imputed.matrix <- mi.completed (imp) #Imputed dataframe from the 1th Imputation (m=NULL, default=1) imputed.matrix <- mi.completed (imp, m=2) #Imputed dataframe from the 2nd Imputation (m=2) imputed.matrix <- mi.completed (imp, m=3, outcome = "matrix") #Imputed matrix from the 3nd Imputation (m=3)