Page 1 of 1

Not enough memory

Posted: Fri Nov 13, 2015 10:05 am
by NaomiKamoen
Dear all,

I am trying to run a model on a dataset containing slightly over 10 million cases. In the model I predict a binomial DV from several predictors. These are allowed to vary between municipalities and between respondents and items (cross classified) within municipalities. There are about 35 municipalities and 30 questions for several thousands of respondents within municipalities. When I fit this model (or a simpler variation) MLWIN seems to be out of capacity. Does anyone have a tips about how I can fit this model? Is there a way to use more than 4g to fit the model?

Thanks in advance for a reply! Naomi Kamoen

Re: Not enough memory

Posted: Fri Nov 13, 2015 10:13 am
by ChrisCharlton
You can use more memory if you use the 64-bit scripting version of MLwiN (mlnscript.exe in the x64 subdirectory). To do this however you will either have to write an MLwiN macro to fit your models or call it from another package such as R (with http://www.bristol.ac.uk/cmm/software/r2mlwin/) or Stata (with http://www.bristol.ac.uk/cmm/software/runmlwin/).

Re: Not enough memory

Posted: Mon Nov 16, 2015 2:27 pm
by NaomiKamoen
Thanks!

Do you know how to access the script via MLWIN? I have found the x64 directory in the program files-folder and I also know how to make a macro to run the model but I don't know how the macro knows to run the model in de 64-bit mode. Thanks again for a reply and best! Naomi

Re: Not enough memory

Posted: Mon Nov 16, 2015 2:32 pm
by ChrisCharlton
The version of mlnscript in the x64 directory always runs the model in 64-bit mode, so to run your macro you would use a command line similar to the one below from a Windows command prompt:

Code: Select all

"c:\Program Files (x86)\MLwiN v2.35\x64\mlnscript.exe" /run "c:\path\to\your\macro.txt"

Re: Not enough memory

Posted: Tue Nov 17, 2015 8:58 am
by NaomiKamoen
Thanks once again!

I am trying to write a macro specifying my model, but now I have two more questions (hopefully these are last ones :)).

When I enter the explanatory variable (EXPL 1 C7) I don't know how I can specify that the variable is binomial and that bcons1 has to be entered as a denominator. I have tried to look this up in the manual and also in the list of commands with I failed to find an answer, so I am probably looking for an answer in the wrong place. Does anyone know the command? In the manual it says that one can manually click to specify the measurement level, and that is what I would normally do when building my model in MLWIN, but that won't work in the 64 bit mode, right?

And finally: How does the 64bit model know on which datafile I want to run the macro? Should I open the file and then go to the 64bit mode? Or is there a code that needs to be used so MLWIN knows which file to run the model on? If I can just open the model it might also be possible to specify the model in MLWIIN and just write a macro to start the model?

Thank you so much for a reply ...I hope my questions are not too silly :S

Best regards, Naomi

Re: Not enough memory

Posted: Tue Nov 17, 2015 10:28 am
by ChrisCharlton
The command to set the response type to binomial is:

Code: Select all

RDISt 1 0
(The first number is the response number and the second is the response type)

To then set the link function to logit you would use:

Code: Select all

LFUN 0
(The number represents the link function)

To set the denominator to the variable "cons" the command is:

Code: Select all

DOFFS 1 "cons"
(The number is the response number and the string is the variable name)

The easiest way to find which commands to use is to use the point-and-click interface to set up your model and then open the Data Manipulation->Command Interface window, and untick the "user" box to see the commands as they are generated. Once you can see this you can search for the relevant command in the on-line help (Help->Contents and Index).

The 64-bit version of mlnscript is a separate application, so it won't automatically know anything about your previous model and you will need to include a command to load the correct data file/worksheet. From the point of view of replication it is often useful to have a macro that sets up everything that is required to run the model, however if you already have a model set up in a worksheet and the problem is when you come to run it then it is possible to load this worksheet from the scripting version and just tell it to run the model that is already set up. At the end of the macro you would then save the worksheet again and could load it back into the GUI MLwiN for post-estimation analysis.