MLwiN macros
- Introduction to macros
- Survival analysis macros
- Time series macros
- Macros for calculating the variance partitioning coefficient (VPC)
- Macro for calculating z-ratios and confidence intervals
Introduction to macros
A complex or frequently-used sequence of commands may be coded using a text editor and stored in an ASCII file for execution by MLwiN as a sequence. Such a stored sequence is called a macro and several may be stored and accessed. There is a macro menu through which individual macros or sets of macros can be accessed. Macros can put up their own menu dialogue windows with check boxes for users to complete. This makes the handling of complex operations or sequences very straightforward. Macros can control graphics output, how the GUI is updated and manipulate certain aspects of MCMC and bootstrap estimation.
MLwiN commands are described in the Command Interface manual (PDF, 867kB).
Instrumental variable estimation for endogenous variables
- An Instrumental Variable Consistent Estimation Procedure to Overcome the Problem of Endogenous Variables in Multilevel Models (PDF, 20kB), A Fielding and Neil Spencer.
- A Comparison of Modelling Strategies for Value-Added Analyses of Educational Data (PDF, 1,193kB), A Fielding and Neil Spencer.
The MLwiN macros used in these papers for instrumental variable estimation are available as a zip file:
- ivmlwin (zip, 3.7 KB)
Survival analysis macros
This is the second version of the survival macros. We have added a few more macros for data exploration such as Kaplan-Meier estimate of survival function and Log rank test.
You can download the worksheet, macros and manual below. We suggest that you copy these files into a subdirectory called DISCRETE, to help avoid confusion with any other macros you may write/use.
In the manual we use the worksheet to illustrate how you fit log duration model and proportional hazard model for single level data as well as multilevel.
- Lifetime worksheet (zip, 0.1 mb)
- Surv macro (zip, 0.1 mb)
- Modelling survival data in MLwiN 1.20 manual appropriate for MLwiN 2.02 (PDF, 869kB).
Time series macros
In previous versions of MLwiN macros were available which allowed fitting of autocorrelated error terms. These macros are no longer supplied as they were found to be unstable. An alternative method for fitting this type of model is described in section 5 of the manual supplement for MLwiN 2.1 (note that although this is described in the documentation for version 2.1 it should also work with version 2.02).
Macros for calculating the variance partitioning coefficient (VPC)
Go to Partitioning variation across levels for help with: General Normal response models; Discrete Response models; Model linearisation (Method A); Simulation (Method B); A binary linear model (Method C); and A latent variable approach (Method D).
Macro for calculating z-ratios and confidence intervals
Macro for calculating z-ratios and confidence intervals (TXT, 1kB).
There is a variety of software you can use to un-zip files, eg WinZip or CAM unZip.
Note: some of the documents on this page are in PDF format. In order to view a PDF you will need Adobe Acrobat Reader