Error "Can't open file ST_634_000008.tmp"

Welcome to the forum for runmlwin users. Feel free to post your question about runmlwin 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 runmlwin: Running MLwiN from within Stata >> http://www.bristol.ac.uk/cmm/software/runmlwin/
Post Reply
PatriciaS
Posts: 1
Joined: Sat Nov 15, 2025 3:18 pm

Error "Can't open file ST_634_000008.tmp"

Post by PatriciaS »

Hi everyone,

I'm trying to run a MAIHDA model in Stata and keep getting the error code in mlwin "Can't open file ST_634_01000008.tmp".
I'm confused, because I'm doing sensitivity analyses for a submitted paper and my code is the same as it was when I did the main analysis, with adapted variables of course. Back then there were no errors at all.

This is the part of the code where the error occurs. The first 10 lines run perfectly fine, after that mlwin opens and I get the error. When I close mlwin it says in Stata that I should run it without the nopause command, but if I do that, Stata says "option rename not allowed".

Code: Select all

* Load the data
use "intersections_age_24", clear

* Fit model 1 in manuscript by PQL2
runmlwin proportion cons, ///
  level2(stratum: cons) ///
  level1(stratum:) ///
  discrete(distribution(binomial) link(logit) denominator(denominator) pql2) ///
  rigls ///
  nopause
  
* Fit model 1 in manuscript by MCMC
runmlwin proportion cons, ///
  level2(stratum: cons, residuals(u, savechains("m1u.dta", replace))) ///
  level1(stratum:) ///
  discrete(distribution(binomial) link(logit) denominator(denominator)) ///
  mcmc(burnin(5000) chain(50000) thinning(50) ///
    savechains("m1b.dta", replace)) initsprevious ///
  nopause
rename u0 m1u
drop u0se
  
* Present the regression coefficients as odds ratios
runmlwin, or

* Calculate the ICC from the parameter point estimates
scalar m1sigma2u = [RP2]var(cons)
scalar m1sigma2e = _pi^2/3
display "ICC = " %9.3f m1sigma2u/(m1sigma2u + m1sigma2e)

* Calculate the ICC from the chains
use "m1b.dta", clear
rename RP2_var_cons_ sigma2u
generate sigma2e =  _pi^2/3
generate icc = sigma2u/(sigma2u + sigma2e)
mcmcsum icc, variables
Thank you so much in advance!
ChrisCharlton
Posts: 1391
Joined: Mon Oct 19, 2009 10:34 am

Re: Error "Can't open file ST_634_000008.tmp"

Post by ChrisCharlton »

This error message suggests that one of the commands in the macro file generated by runmlwin is failing. At this point MLwiN should open the macro file and display the line causing the error, but in this case it isn't able to find and show it (which is where the error is coming from).

A few things to try are:
  • From within MLwiN Open Data Manipulation>Command Interface and click the Output button. There may be a more informative error message displayed there.
  • Before shutting MLwiN locate the file that it is currently referring to in the error (probably in the %TEMP% directory). Open and run this file as a macro in a new instance of MLwiN and see whether you get a more informative message running it that way.
  • If you are unable to find the file referenced above add the viewfullmacro option to your MLwiN command. This should then open the generated macro in a Stata window, which you can copy/paste into a new instance of MLwiN and manually run from there.
Post Reply