realcomImputeLoad error

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/
Post Reply
daoudasissoko
Posts: 6
Joined: Wed Nov 28, 2012 1:25 am

realcomImputeLoad error

Post by daoudasissoko » Wed Feb 05, 2014 6:39 am

Hi everybody,
After running my imputation on REALCOM, I failed to import imputed dataset in STATA even if impvals are in my STATA working directory. I didn't find any solution in previous posts.
Many thanks for your help.
D Sissoko

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

Re: realcomImputeLoad error

Post by ChrisCharlton » Wed Feb 05, 2014 5:23 pm

Would it be possible for you to post the syntax that you are using, as well as the error messages generated by Stata?

daoudasissoko
Posts: 6
Joined: Wed Nov 28, 2012 1:25 am

Re: realcomImputeLoad error

Post by daoudasissoko » Thu Feb 06, 2014 5:38 am

Hi Chris,
Thank you very much for our reply.
My command is:realcomImpute Dtp3 Dtp2 Dtp1 sexchild Ibirthor_22 Ibirthor_23 Ibirthor_24 Icaste_21 Icaste_22 Icaste_23 ilschoolm1 ilschoolm2 ilschoolm3 ilschoolm4 igrpagemot21 igrpagemot22 igrpagemot23 igr_lschoolf1 igr_lschoolf2 igr_lschoolf3 igr_lschoolf4 pnc_2 tetanus_2 i_ancvisits1 i_ancvisits2 Infac1_21 Infac1_22 Infac1_23 Infac1_24 povertypsu1 indregion_ipps1 indregion_ipps2 indregion_ipps4 indregion_ipps5 indregion_ipps6 using "C:\villagesind_04fev2014.dat",replace numresponses(3) level2id( idstate_dist ) cons(cons)

(note: file C:\villagesind_04fev2014.dat not found)
Data saved to C:\villagesind_04fev2014.dat

And then I started run MCMC after model speicification and setting up needed information on Realcom (NRTYPE, Burn-in, iterations,etc,)
After the computations and when trying to import imputed datasets in STATA by typing realcomImputeLoad, unfortunately a following message appears " file impvals.txt not found r(601) " even if the file impals is present in the same working folder as STATA.
Thank you for our help
Daouda

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

Re: realcomImputeLoad error

Post by ChrisCharlton » Thu Feb 06, 2014 9:55 am

Looking at the code for realcomImputeLoad the line producing the error that you are seeing is:

Code: Select all

quietly insheet using impvals.txt, clear nonames
so you could try this yourself without the quietly to see whether there are any additional error messages.

Note, you will need both the impvals.txt and the imputed datasets to be be in the working directory. To check that Stata is looking in the correct place you can issue the command:

Code: Select all

pwd
which will cause Stata to display the current working directory.

daoudasissoko
Posts: 6
Joined: Wed Nov 28, 2012 1:25 am

Re: realcomImputeLoad error

Post by daoudasissoko » Thu Feb 06, 2014 1:38 pm

Maybe, the problem is in my imputations and not in loading into STATA. I added extra iterations (1000 more iterations).
Below, the output in Realcom monitor:

Level1_covariance_matrix =
0.0538 0.0186 0.0002
0.0186 0.0311 0.0003
0.0002 0.0003 0.0027

Level1_covariance_matrix_SDs =
1.0e-03 *
0.4096 0.2353 0.0638
0.2353 0.2621 0.0509
0.0638 0.0509 0.0246
Level2_covariance_matrix =
0.0020 0.0009 0.0001
0.0009 0.0005 0.0000
0.0001 0.0000 0.0000


Level2_covariance_matrix_SDs =

1.0e-03 *

0.1749 0.0937 0.0208
0.0937 0.0659 0.0115
0.0208 0.0115 0.0035
Iteration time 1240 minutes 33 seconds
responses imputed at iteration after burn-in 400
responses imputed at iteration after burn-in 800
responses imputed at iteration after burn-in 1200
responses imputed at iteration after burn-in 1600
responses imputed at iteration after burn-in 2000
responses imputed at iteration after burn-in 2400
responses imputed at iteration after burn-in 2800
responses imputed at iteration after burn-in 3200
responses imputed at iteration after burn-in 3600
responses imputed at iteration after burn-in 4000
Warning: checkbox control requires a scalar Value
Control will not be rendered until all of its parameter values are valid
Warning: checkbox control requires a scalar Value
Control will not be rendered until all of its parameter values are valid
> In C:\Program Files (x86)\MATLAB\MATLAB Compiler Runtime\v80\toolbox\matlab\wi
nfun\actxcontrol.p>getCurrentCanvasAndHwnd at 407
In C:\Program Files (x86)\MATLAB\MATLAB Compiler Runtime\v80\toolbox\matlab\wi
nfun\actxcontrol.p>actxcontrol at 155
In output at 53
In gui_2levmixresp>resultsbtn_Callback at 334
In gui_mainfcn at 96
In gui_2levmixresp at 46
In @(hObject,eventdata)gui_2levmixresp('resultsbtn_Callback',hObject,eventdata
,guidata(hObject))
Copy = void Copy(handle)
Cut = void Cut(handle)
Paste = void Paste(handle)
Undo = void Undo(handle)
Redo = void Redo(handle)
SelectAll = void SelectAll(handle)
DialogOtherStyle = void DialogOtherStyle(handle)
DialogDefineStyle = void DialogDefineStyle(handle)
DialogOtherSize = void DialogOtherSize(handle)
DialogDefineSize = void DialogDefineSize(handle)
SetStyle = int32 SetStyle(handle, int32)
GetStyle = int32 GetStyle(handle)
SetSizeLargeOp = void SetSizeLargeOp(handle)
SetSizeRegular = void SetSizeRegular(handle)
SetSizeSubscript = void SetSizeSubscript(handle)
SetSizeSubSubscript = void SetSizeSubSubscript(handle)
SetSizeSmaller = void SetSizeSmaller(handle, int32)
SetSizeLarger = void SetSizeLarger(handle, int32)
SetMathML = void SetMathML(handle, string)
GetMathML = Variant(Pointer) GetMathML(handle, Variant(Pointer))
ExportImage = void ExportImage(handle, string)
EmulateToolbarButton = void EmulateToolbarButton(handle, string)
GetCopyright = Variant(Pointer) GetCopyright(handle, Variant(Pointer))
RelayMessage = int32 RelayMessage(handle, int32, int32, int32)
GetMathMLStr = string GetMathMLStr(handle)
GetCopyrightStr = string GetCopyrightStr(handle)
ExportEMF = void ExportEMF(handle, string)
ExportXHTML = void ExportXHTML(handle, string)
GetFormulatorLicenseInfo = int32 GetFormulatorLicenseInfo(handle)
Thanks

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

Re: realcomImputeLoad error

Post by ChrisCharlton » Thu Feb 06, 2014 2:31 pm

Although you get an error message at the end it does look like data has been imputed (indicated by the line "responses imputed at iteration after burn-in ..."). As long as it has generated the impvals.txt files and the related imputed datasets then you should be able to load these into Stata.

daoudasissoko
Posts: 6
Joined: Wed Nov 28, 2012 1:25 am

Re: realcomImputeLoad error

Post by daoudasissoko » Thu Feb 06, 2014 6:20 pm

While quietly insheet using impvals.txt, clear nonames does not work,quietly insheet using C:\Realcom\impvals.txt, clear nonames seems to function. Nevertheless, STATA only import a fragment namely V1 to Vn (n= number of imputations) and not the entire dataset.

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

Re: realcomImputeLoad error

Post by ChrisCharlton » Thu Feb 06, 2014 6:48 pm

The impvals.txt file only contains information about the imputed datasets, rather than the data itself so I think Stata is loading what I would expect. It therefore sounds like the problem is that you're running the command from the wrong directory. Could you try the running the following command in Stata:

Code: Select all

cd c:\Realcom
and then seeing whether the realcomImputeLoad command works for you?

daoudasissoko
Posts: 6
Joined: Wed Nov 28, 2012 1:25 am

Re: realcomImputeLoad error

Post by daoudasissoko » Thu Feb 06, 2014 7:27 pm

Great Chris, it works finally. Stata has imported all imputed datasets. I 'm wondering if Realcomme can combine my datasets to one dataset or I have to do it in Stata
Many thanks

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

Re: realcomImputeLoad error

Post by ChrisCharlton » Thu Feb 06, 2014 7:40 pm

Realcom will only save the separate imputed datasets, however I believe that the form in which realcomImputeLoad brings the data into Stata should be ready for use by the Stata mi (http://www.stata.com/help.cgi?mi) commands to use.

Post Reply