I am attempting to convert a multiply imputed dataset into a mids object with the as.mids() command and receive the following error:
Error in `[<-.data.frame`(`*tmp*`, j, value = list(enrollment_final_IMP = c(1L, :
replacement element 1 has 15 rows, need 19
In addition: Warning messages:
1: In data.matrix(x) : NAs introduced by coercion
2: In `[<-.data.frame`(`*tmp*`, j, value = list(enrollment_final_IMP = c(4L, :
replacement element 1 has 21 rows to replace 19 rows
Curiously, I've never previously encountered problems with this step and the error does not seem to be reproducible with any of the sample datasets (e.g. boys) or when I use a truncated version of my imputed dataset (with head).
The imputed dataframe was generated using mice and complete as part of the mice package. Below is a sample:
I am attempting to convert a multiply imputed dataset into a
mids
object with theas.mids()
command and receive the following error:Curiously, I've never previously encountered problems with this step and the error does not seem to be reproducible with any of the sample datasets (e.g. boys) or when I use a truncated version of my imputed dataset (with
head
).The imputed dataframe was generated using
mice
andcomplete
as part of themice
package. Below is a sample:Thank you in advance for any recommendations!