R2MLwiN is showing "Error in read.dta(chainfile[i]): unable to open file: 'No such file or directory'"

Welcome to the forum for R2MLwiN users. Feel free to post your question about R2MLwiN 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 to R2MLwiN: Running MLwiN from within R >> http://www.bris.ac.uk/cmm/software/r2mlwin/
Post Reply
dcanarteg
Posts: 14
Joined: Tue Feb 05, 2019 9:30 pm

R2MLwiN is showing "Error in read.dta(chainfile[i]): unable to open file: 'No such file or directory'"

Post by dcanarteg » Fri Feb 22, 2019 8:17 pm

Hello
After successfully running 4 models before the one below. I am having the following error

"Error in read.dta(chainfile) :
unable to open file: 'No such file or directory'"

What does it mean " error while obeying batch file..... at line number 197"?

The formula below is for a Hierarchical Logistic Regression.

Thanks

Below is the output copied and pasted from my console.
##############################################################################
> m5 = logit(AltAnySupport) ~ 1 + TieIsFamily + TieSameSex + TieSameAge + EgoMarital + EgoSex +
EgoTMig + AltSex + AltIsRoma + AltNatRomanian + AltResidence + NetPropFemCen + NetPropFamCen +
NetPropIsRomaCen + NetPropNatRomanianCen + NetPropResidCen + EgoTMig:AltIsRoma +
EgoSex:AltIsRoma + EgoTMig:TieSameSex + (1 | EgoIdentifier)
> (VarCompModel5 <- runMLwiN(Formula = m5, D = "Binomial", data = RomaAllData2,
estoptions = list(EstM = 1)))

MLwiN is running, please wait......
/nogui option ignored
ECHO 0

Echoing is ON
BATC 1

Batch mode is ON
MAXI 2
STAR
iteration 0
iteration 1

Convergence not achieved
TOLE 2
MAXI 20
BATC 1

Batch mode is ON
NEXT
iteration 2
iteration 3
iteration 4
iteration 5
iteration 6

Convergence achieved
ECHO 0

Echoing is ON
MCMC 0 500 1 5.8 50 10 G30[1] G30[2] 2 2 2 1 1 2

error while obeying batch file /var/folders/3n/zvw9lr5s1c1dnl0jkrc8y2xh0000gn/T//Rtmp8C7bVa/macrofile_149428d0dce5.txt at line number 197:
MCMC 0 500 1 5.8 50 10 C2498] C2499] 2 2 2 1 1 2
MCMC Error 0002 : Matrix must be positive definite for inversion

error while obeying batch file /var/folders/3n/zvw9lr5s1c1dnl0jkrc8y2xh0000gn/T//Rtmp8C7bVa/macrofile_149428d0dce5.txt at line number 197:
MCMC 0 500 1 5.8 50 10 C2498] C2499] 2 2 2 1 1 2
Unable to invert xtx
dealloc_all

error while obeying batch file /var/folders/3n/zvw9lr5s1c1dnl0jkrc8y2xh0000gn/T//Rtmp8C7bVa/macrofile_149428d0dce5.txt at line number 197:
MCMC 0 500 1 5.8 50 10 C2498] C2499] 2 2 2 1 1 2

Unable to invert xtx.
Execution completed

Error in read.dta(chainfile) :
unable to open file: 'No such file or directory'

##############################################################################

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

Re: R2MLwiN is showing "Error in read.dta(chainfile[i]): unable to open file: 'No such file or directory'"

Post by ChrisCharlton » Tue Feb 26, 2019 10:29 am

The error message indicates an estimation problem, possibly due to the data or starting values. I would suggest trying to fit the same model using IGLS (i.e. by removing EstM=1) and seeing whether you get any estimates of zero, or other estimation problems there. If so it might suggest a problem such as high correlations between some of your variables. You might be able to persuade MCMC to run if you specify manual starting values (see chapter 5 of the MCMC guide at http://www.bristol.ac.uk/cmm/software/r2mlwin/examples/), however I would suggest looking closely at the parameter chains to check that they are behaving correctly. Another thing to try would be simplified versions of the model to see which variables cause the problem when added.

dcanarteg
Posts: 14
Joined: Tue Feb 05, 2019 9:30 pm

Re: R2MLwiN is showing "Error in read.dta(chainfile[i]): unable to open file: 'No such file or directory'"

Post by dcanarteg » Tue Feb 26, 2019 12:49 pm

Thank you! I'll try that

Post Reply