Page 1 of 1

Error message: invalid variable names

Posted: Mon Oct 03, 2011 9:44 am
by laura
Hi,

I'm getting the following message when I use runmlwin:

"Some variables have names which are invalid in Stata, this may cause a problem when you load the data"

You can then click ok and the model runs fine, but each models causes this message to flash up.

The variable names were all generated in Stata and are fine, and the runmlwin script is not returning any new variables (e.g. no residual variables being returned). And we've run the do file before and not got this error message.

We just updated to v1.24 and are still getting the error.

Any ideas?!

Thanks,
Laura

Re: Error message: invalid variable names

Posted: Mon Oct 03, 2011 12:02 pm
by ChrisCharlton
When MLwiN saves a Stata file it checks each variable that it is saving to make sure it's name is alphanumeric and doesn't start with a digit. It also checks that it isn't one of the following reserved variable names:

_all, _long, _N, in, _skip, _weight, _pred, _cons, float, _b, _n, pi, int, using, with, _rc, double, if, _coef

One way to find the cause of the problem is to add the option viewfullmacro to the end of your runmlwin command line and then look for lines that start with SSTA and contain variable names that break the above rules in the viewer window that is displayed.

Re: Error message: invalid variable names

Posted: Mon Oct 03, 2011 1:53 pm
by laura
Thanks for these replies.

We have a variable named pi, so that must have been the problem. We will rename it!

Oddly, the error message comes up on my colleague's laptop, but not on my networked University of Bristol PC. So same data, same do file, runs fine on one but not the other. Something to do with the networked version of Stata???

Cheers,
Laura

Re: Error message: invalid variable names

Posted: Mon Oct 03, 2011 3:52 pm
by ChrisCharlton
I have just checked the Stata manual and it turns out that a few of the reserved variable names that MLwiN checks for are wrong (for example it should check for _pi instead of pi). This will be fixed in the next release of MLwiN.