Multiply Imputed Datasets
-
- Posts: 4
- Joined: Fri Dec 02, 2016 5:14 pm
Multiply Imputed Datasets
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?
-
- Posts: 1354
- Joined: Mon Oct 19, 2009 10:34 am
Re: Multiply Imputed Datasets
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.
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.
-
- Posts: 4
- Joined: Fri Dec 02, 2016 5:14 pm
Re: Multiply Imputed Datasets
i will give it a try and see if it works! many thanks for your reply
-
- Posts: 4
- Joined: Fri Dec 02, 2016 5:14 pm
Re: Multiply Imputed Datasets
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
-
- Posts: 1354
- Joined: Mon Oct 19, 2009 10:34 am
Re: Multiply Imputed Datasets
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:
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.
Code: Select all
var1 var2 var3
1000
5
impute1 impute2 impute3 impute4 impute5
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.
-
- Posts: 4
- Joined: Fri Dec 02, 2016 5:14 pm
Re: Multiply Imputed Datasets
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.
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.
-
- Posts: 1354
- Joined: Mon Oct 19, 2009 10:34 am
Re: Multiply Imputed Datasets
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.