### Binary covariate and run time errors using the nlevel imputation template

Posted:

**Wed Sep 05, 2018 2:00 pm**Hi,

I've been trying to use the nlevel imputation template to impute missing data for a four level model with 1775 respondents and I'm running into a few problems. My data has been processed in R and saved as a STATA file and contains a mixture of user collected test score data, combined with linked variables from an NPD extract (FSMever, KS1 scores, and school-level KS1 and KS2 averages. Whenever I've entered binary covariates into the imputation model such as treatment, fsm and sex of respondent, it throws an error and won't allow me to run the algorithm. If I exclude these or specify them as ordered categories the algorithm does run and converges to reasonably sensible values (similar to those I can impute on the fly in Rstan), but does this sound like a bug or is something potentially going wrong with the way I'm preparing the data? When I've imputed as a two-level model of pupils clustered in schools and specify the binary covariates correctly, the algorithm does run, which makes me think there is an underlying bug.

My other problem is that when I add a school level covariate or two into imputation model, the algorithm will run for 20-30 seconds or so, and then crash with a runtime error. I've tried it with a two-level model and it runs flawlessly, but I can't get past those initial 20-30 seconds when the algorithm is burning in and adapting. Any help or suggestions would be very much appreciated.

Many thanks,

I've been trying to use the nlevel imputation template to impute missing data for a four level model with 1775 respondents and I'm running into a few problems. My data has been processed in R and saved as a STATA file and contains a mixture of user collected test score data, combined with linked variables from an NPD extract (FSMever, KS1 scores, and school-level KS1 and KS2 averages. Whenever I've entered binary covariates into the imputation model such as treatment, fsm and sex of respondent, it throws an error and won't allow me to run the algorithm. If I exclude these or specify them as ordered categories the algorithm does run and converges to reasonably sensible values (similar to those I can impute on the fly in Rstan), but does this sound like a bug or is something potentially going wrong with the way I'm preparing the data? When I've imputed as a two-level model of pupils clustered in schools and specify the binary covariates correctly, the algorithm does run, which makes me think there is an underlying bug.

My other problem is that when I add a school level covariate or two into imputation model, the algorithm will run for 20-30 seconds or so, and then crash with a runtime error. I've tried it with a two-level model and it runs flawlessly, but I can't get past those initial 20-30 seconds when the algorithm is burning in and adapting. Any help or suggestions would be very much appreciated.

Many thanks,