I'm trying to use data imputed in Mplus in a subsequent latent class analysis with clustering (ANALYSIS: TYPE=COMPLEX MIXTURE), but I'm getting the following: *** ERROR When using TYPE=IMPUTATION, the number of observations in all data sets must be the same. Current data file: C:\[path]\impmisstoo2.dat Average number of observations in previous data files: 5506 Number of observations in current data file: 5511
This happens only if I use the SUBPOPULATION command to limit observations to males or females (the number of observations in the error changes). I did impute sex and other covariates in the original imputation file, but did not impute the cluster variable or the latent class indicators.
I would appreciate it if you could help me figure out what is going on. Thanks--
The current imputation implementation requires that the imputed data sets are of the same size. You can trim the longer data sets by adding the option nobs=5506 to the data command where 5506 would be the size of the smallest imputed data set. Alternatively, you can combine the full multiply imputed data analysis by hand.
Thanks for that answer. I guess I'm still confused though; why would Mplus think my datasets had different numbers of observations? It only seems to happen when I limit with SUBPOPULATION, but since I've imputed the SUBPOPULATION variable in the imputed datasets (sex), it seems that shouldn't affect the number of observations in the analysis that is run with imputation, right?
Nevermind; figured it out. My datasets have the same number of observations, but because I was imputing the SUBPOPULATION variable of sex, sometimes boys became girls, and vice versa. I redid my imputation without the sex variable and now it is fine.