Multiply Imputed Datasets

Welcome to the forum for MLwiN users. Feel free to post your question about MLwiN software here. The Centre for Multilevel Modelling take no responsibility for the accuracy of these posts, we are unable to monitor them closely. Do go ahead and post your question and thank you in advance if you find the time to post any answers!

Remember to check out our extensive software FAQs which may answer your question: http://www.bristol.ac.uk/cmm/software/s ... port-faqs/
Post Reply
Georgiades
Posts: 4
Joined: Fri Dec 02, 2016 5:14 pm

Multiply Imputed Datasets

Post by Georgiades »

is there a way to read in multiply imputed datasets that were created in R and exported into SPSS into MLwiN? and will MLwiN pool the estimates automatically?
ChrisCharlton
Posts: 1354
Joined: Mon Oct 19, 2009 10:34 am

Re: Multiply Imputed Datasets

Post by ChrisCharlton »

To do this you would need to manipulate the files so that they were in the same format generated by Realcom-Impute (for a description of this see http://www.bristol.ac.uk/media-library/ ... tation.pdf). If you used this method then MLwiN would combine the parameter results using Rubin's rules.

An alternative if you are imputing the datasets within R would be to call MLwiN via R2MLwiN (see http://www.bristol.ac.uk/cmm/software/r2mlwin/) and then use the appropriate R packages to combine the model estimates.
Georgiades
Posts: 4
Joined: Fri Dec 02, 2016 5:14 pm

Re: Multiply Imputed Datasets

Post by Georgiades »

i will give it a try and see if it works! many thanks for your reply
Georgiades
Posts: 4
Joined: Fri Dec 02, 2016 5:14 pm

Re: Multiply Imputed Datasets

Post by Georgiades »

we are struggling with manipulating the file so that it is in the same format as realcom-impute. we read the document you sent us but still cant get the format correct so it can be read into MLwiN. Would you happen to have a more detailed example of how to structure it and how to read it into MLwiN so we can get pooled estimates using 2- and 3-level models. thanks
ChrisCharlton
Posts: 1354
Joined: Mon Oct 19, 2009 10:34 am

Re: Multiply Imputed Datasets

Post by ChrisCharlton »

Assuming that you had imputed the variables var1 var2 and var3 five times and the number of rows of data was 1000 then you would create five files containing the tab-delimited data for these variables (with no column headers) in the same order (I will assume that these are named impute1, impute2, impute3, impute4 and impute5). You would then create a file called impvals.txt in the same directory with the following structure:

Code: Select all

var1 var2 var3
1000
5
impute1 impute2 impute3 impute4 impute5
Note that values should be separated with tabs.

From within MLwiN you could then point to the directory containing these files and it would use the imputed variables with the model that you currently have set up.
Georgiades
Posts: 4
Joined: Fri Dec 02, 2016 5:14 pm

Re: Multiply Imputed Datasets

Post by Georgiades »

thank-you. Three more follow-up questions:
1. Do the imputed tab-delimited files also contain all the other variables that we are using in our MLM models but that were not imputed (i.e., school and child ID, weights and any variables with complete data)? I am assuming that the imputed files need to be identically structured as the observed variable file, in terms of the order of variables etc. Is that correct? or are the imputed files restricted to only those variables that have been imputed?

2. Can MLwiN pool estimates for a 2-level binary logistic model?

3. Can we run 3-level models and get pooled estimates (students, classrooms, schools), if the upper levels of data are complete?

thank you very much.
ChrisCharlton
Posts: 1354
Joined: Mon Oct 19, 2009 10:34 am

Re: Multiply Imputed Datasets

Post by ChrisCharlton »

Variables with complete cases do not need to be included in the file, however doing so shouldn't do any harm. Essentially when you run the model of interest within MLwiN it replaces variables used in the current model with ones whose name matches in the imputed data set. As the matching is done by name the order of the variables in the file should not matter as long as they are correctly labelled in the control file. It does this for each of the imputed data sets provided and then combines the parameter results for all the model runs using Rubin's rules. This procedure is the same regardless of the model being fitted, although only the (R)IGLS estimation method is supported.
Post Reply