Easiest way to use mlwin via script

Welcome to the forum for MLwiN users. Feel free to post your question about MLwiN software 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!

Remember to check out our extensive software FAQs which may answer your question: http://www.bristol.ac.uk/cmm/software/s ... port-faqs/
Post Reply
GerineLodder
Posts: 42
Joined: Thu Jul 28, 2016 11:33 am

Easiest way to use mlwin via script

Post by GerineLodder »

After some searches on the website, I saw that there are several ways to use a text-based command for MLWIN (e.g., via R or via macros).
I was wondering whether you could advice me on the best way to do this in my situation.

I have ran several quite heavy models in MLwin, using multiple membership models, longitudinal data for > 15.000 cases with multinomial outcome variables. Even the empty models have difficulties to converge and take up to a few days to complete.

Luckily, we have a supercomputer at our university that can be used for these kinds of things.
However, you cannot use the point-and-click interface on this computer: Everything has to be ran via 1 syntax file.
I have limited experience with programs like R, and I was wondering if you could advice me on the easiest method to create such a syntax file for MLwin.
I would like to run my analysis (or even better: multiple analyses, for instance multiple nested models) via this syntax file, and also include some graphical output such as the trajectories for each parameter etc. including the additional information.

Any advice would be greatly appreciated!
ChrisCharlton
Posts: 1354
Joined: Mon Oct 19, 2009 10:34 am

Re: Easiest way to use mlwin via script

Post by ChrisCharlton »

If you are familiar with R or Stata then the easiest way is to get these packages to generate and run the necessary syntax code via R2MLwiN (see http://www.bristol.ac.uk/cmm/software/r2mlwin/) or runmlwin (see http://www.bristol.ac.uk/cmm/software/runmlwin/). These present the estimation options available in MLwiN in a form that matches that of the host package and then brings back the results into a standard structure. We provide extensive examples for both of these packages, including replicating most of the models in the MLwiN manuals.

Alternatively you can set up your model directly using MLwiN syntax. You can find information on the available commands via the built-in help file, the command manual (see http://www.bristol.ac.uk/cmm/software/m ... nuals.html) or by unselecting "user" in the MLwiN command interface window and watching the commands that are generated as you use the GUI. Once you have a working script you can run this via the scripting version of MLwiN (mlnscript.exe) using the /run command line option. Note that this method does not have a way of saving graphs as part of the script, so if you need these I would recommend using one of the packages above and using the graphing facilities available in R/Stata. Alternatively you would need to save the necessary data during the script run and generate the graphs manually afterwards.
GerineLodder
Posts: 42
Joined: Thu Jul 28, 2016 11:33 am

Re: Easiest way to use mlwin via script

Post by GerineLodder »

Thank you for your response!
I have worked a bit with R but am certainly no expert, therefore I was wondering whether there might be easier alternatives.
If I read your message, it seems like that may not be the case.
So I will try to get re-acquainted with my old enemy R ;)
Post Reply