mids
objects by rowsThis function combines two mids
objects rowwise into a single
mids
object, or combines a mids
object with a vector, matrix,
factor or dataframe rowwise into a mids
object.
rbind.mids(x, y = NULL, ...)
A mids
object.
A mids
object, or a data.frame
, matrix
, factor
or vector
.
Additional data.frame
, matrix
, vector
or factor
.
These can be given as named arguments.
An S3 object of class mids
If y
is a
mids
object, then rbind
requires that the number of
multiple imputations in x
and y
is identical. Also,
columns of x$data
and y$data
should match.
If y
is not a mids
object, the columns of x$data
and y
should match. The where
matrix for y
is set
to FALSE
, signaling that any missing values
in y
were not imputed.
van Buuren S and Groothuis-Oudshoorn K (2011). mice
:
Multivariate Imputation by Chained Equations in R
. Journal of
Statistical Software, 45(3), 1-67.
https://www.jstatsoft.org/v45/i03/
# NOT RUN {
imp1 <- mice(nhanes[1:13, ], m = 2, maxit = 1, print = FALSE)
imp5 <- mice(nhanes[1:13, ], m = 2, maxit = 2, print = FALSE)
mylist <- list(age = NA, bmi = NA, hyp = NA, chl = NA)
nrow(complete(rbind(imp1, imp5)))
nrow(complete(rbind(imp1, mylist)))
nrow(complete(rbind(imp1, data.frame(mylist))))
nrow(complete(rbind(imp1, complete(imp5))))
# }
Run the code above in your browser using DataLab