Problem with realcomimputeLoad in Stata

Welcome to the forum for REALCOM users. Feel free to post your question about REALCOM 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!

Go REALCOM (Developing multilevel models for REAListically COMplex social science data) >> http://www.bristol.ac.uk/cmm/software/realcom/
Chrisstei78
Posts: 7
Joined: Sat Aug 13, 2016 8:58 pm

Problem with realcomimputeLoad in Stata

Post by Chrisstei78 »

Hello,

I have exported data from Stata to RealcomImpute and created 10 imputated datasets. My model has 14 response variables (all level 1), and 16 explanatory variables (2 on level 1 and 14 on level 2).

The impvals.txt file in my directory shows this content:
screen 3.jpg
screen 3.jpg (68.01 KiB) Viewed 22116 times
When load my original data in Stata, change the directory to the imputed data is stored, and type “realcomimputeLoad”, I get this error message:
screen 4.jpg
screen 4.jpg (90.02 KiB) Viewed 22116 times
I have rebooted the computer to no avail. I have also double-checked if the ado has been installed. I am using Stata 12.1.

Any idea what could have gone wrong? Any suggestions would be greatly appreciated!

Christoph
ChrisCharlton
Posts: 1348
Joined: Mon Oct 19, 2009 10:34 am

Re: Problem with realcomimputeLoad in Stata

Post by ChrisCharlton »

It might just be that you have the case slightly wrong. If you look at http://missingdata.lshtm.ac.uk/stata/re ... teLoad.ado you will see that the correct command name is realcomImputeLoad (note the capital I). If correcting this doesn't help can you run the command:

Code: Select all

which realcomImputeLoad
to see whether Stata is correctly finding the ado file?
Chrisstei78
Posts: 7
Joined: Sat Aug 13, 2016 8:58 pm

Re: Problem with realcomimputeLoad in Stata

Post by Chrisstei78 »

Thanks, Chris! This is silly mistake.

But since we are at it, when I try to fit my model I get this error message in Stata.
screen 5.jpg
screen 5.jpg (44.23 KiB) Viewed 22109 times
However, I can estimate the models when I change the dependent variable.

Does that indicate something with the imputation of the main dependent variable went wrong? Can I simply ignore this with the commandv"esampvaryok"?

I imputed 10 datasets twice, with the same imputation model but different burn-in and iteration specifications. When I load them into Stata the result is the same.
Last edited by Chrisstei78 on Sat Aug 13, 2016 10:24 pm, edited 1 time in total.
Chrisstei78
Posts: 7
Joined: Sat Aug 13, 2016 8:58 pm

Re: Problem with realcomimputeLoad in Stata

Post by Chrisstei78 »

UPDATE:

I checked all ten imputations of the dependent variable and found that missing values have not been imputed in the second one, but in all other imputations.

Here is the imputation trace graph for the relevant variable.
Monitor.jpg
Monitor.jpg (42.09 KiB) Viewed 22107 times
ChrisCharlton
Posts: 1348
Joined: Mon Oct 19, 2009 10:34 am

Re: Problem with realcomimputeLoad in Stata

Post by ChrisCharlton »

That is pretty puzzling, as the program should be doing exactly the same steps for each imputed data set. If the model doesn't take too long to run you could try imputing with a different interval between imputations, or with more imputed data-sets to see if there is a pattern. Are you checking the raw files saved from Realcom-Impute, or the data-sets after they have been loaded into Stata?
Chrisstei78
Posts: 7
Joined: Sat Aug 13, 2016 8:58 pm

Re: Problem with realcomimputeLoad in Stata

Post by Chrisstei78 »

I am checking the files after they have been imported into Stata.
ChrisCharlton
Posts: 1348
Joined: Mon Oct 19, 2009 10:34 am

Re: Problem with realcomimputeLoad in Stata

Post by ChrisCharlton »

Would you also be able to check the files saved from Realcom-Impute (imputeiter1000, imputeiter2000, ...)? These are plain text files and should contain the imputed data. If these look okay then there may be a problem with the Stata command, in which case depending on your level of Stata knowledge I would suggest either manually replicating the contents of realcomImputeLoad.ado to identify the problem or contacting the author, Jonathan Bartlett.
Chrisstei78
Posts: 7
Joined: Sat Aug 13, 2016 8:58 pm

Re: Problem with realcomimputeLoad in Stata

Post by Chrisstei78 »

When I open imputeiter.1000 and 2000 in Firefox I cannot spot any fundamental difference. Is the first response variable (in the order they have been imported into RealcomImpute) listed in the first column from the left side? If so, then the variable looks similar and okay in both imputeiter.1000 and 2000.
Last edited by Chrisstei78 on Sun Aug 14, 2016 6:10 pm, edited 2 times in total.
ChrisCharlton
Posts: 1348
Joined: Mon Oct 19, 2009 10:34 am

Re: Problem with realcomimputeLoad in Stata

Post by ChrisCharlton »

The ordering of the variables in the imputation file should match the first row in your impvals.txt file, and in your case there should be 14 of them. The ordering of the rows should be the same as in your original data. If the positions that were originally missing in your input data have sensible looking values in both imputeiter files then it is likely that the RealcomImputeLoad command has failed to correctly load that file.
Chrisstei78
Posts: 7
Joined: Sat Aug 13, 2016 8:58 pm

Re: Problem with realcomimputeLoad in Stata

Post by Chrisstei78 »

I see, thanks. Then all my imputed datasets look similar and complete when inspected outside of Stata.

I produced a further set of 10 imputed datasets with different iteration specifications. The result for the problematic variable above is the same, and it again occurred in imputed dataset 2 when I re-import it into Stata.

Just in case this cannot be resolved, would it be possible to produce a higher number of imputed datasets (let's say 11) and then tell stata to exclude the one with reduced numbers of cases? How would I do that? Although this may not be ideal, it may at least be a temporary work-around.

Many thanks for your prompt response even on a weekend!
Last edited by Chrisstei78 on Mon Aug 15, 2016 9:37 am, edited 1 time in total.
Post Reply