# Resources for using MLwiN

Over the years the team has written a large number of resources for using MLwiN. While there is a rolling program of updating, inevitably some materials lag behind others. This page is meant to point you where to look for further help in using MLwiN to estimate models. It gives an overview of our materials.

Where there are multiple entries for a topic, we have tried to put the most introductory first, followed by the most comprehensive; the most technical comes at the end.

- The resources
- Other sources of help
- Multilevel modelling: the background
- Hierarchical normal-theory models
- Models with multiple responses (including multivariate and panel models
- Discrete outcomes
- Non-Hierarchical models
- Estimation
- Data and design
- MLwiN functioning
- Interoperability: using MLwiN with other software
- Other software and how it can be used with CMM materials
- Further training and information

## The resources

**USER:** Rasbash, J., Steele, F., Browne, W.J. and Goldstein, H. (2017) A User's Guide to MLwiN, v3.00 (PDF, 4,395kB), Centre for Multilevel Modelling, University of Bristol.

**MCMC:** Browne, W.J. (2017) MCMC Estimation in MLwiN, v3.00 (PDF, 6,430kB), Centre for Multilevel Modelling, University of Bristol.

**SUPP:** Rasbash, J., Charlton, C., Jones, K. and Pillinger, R. (2017) Manual Supplement to MLwiN, v3.00 (PDF, 1,931kB), Centre for Multilevel Modelling, University of Bristol.

**COMMAND:** Rasbash, J., Browne, W.J. and Goldstein, H. (2003) MLwiN 2.0 Command Manual (PDF, 880kB), Centre for Multilevel Modelling, University of Bristol.

**FAQ: ** CMM software support Frequently Asked Questions

**LEMMA: ** Multilevel modelling online course

**REALCOM: ** Developing multilevel models for REAListically COMplex social science data

**C&Hvol1:** Jones, K and Subramanian, V S (2014) Developing multilevel models for analysing contextuality, heterogeneity and change using MLwiN, Volume 1 , University of Bristol.

**C&Hvol2:** Jones, K and Subramanian, V S (2013) Developing multilevel models for analysing contextuality, heterogeneity and change using MLwiN, Volume 2, University of Bristol.

**Gallery:** the Multilevel Gallery which is a database of (mostly) published journal articles which fit multilevel models. It is searchable by model type and substantive area.

**TEXT:** MLwiN Textbook Examples provided by UCLA Statistical Consulting Group

## Other sources of help

This is a guide to all the materials that CMM have, for further assistance:

- All users can post enquiries to the MLwiN user forum
- If you have bought MLwiN, you may be entitled to email support. (If you are a UK academic and have downloaded the free version, unfortunately, you are not entitled to free support.)
- You can also join the JISC Multilevel Modelling discussion list which is a general discussion list that is not run by CMM.

## Multilevel modelling: the background

Structures and classifications | StructuresLemma Module 4 |

What types of model can be fitted in MLwiN? | Types |

Basic concepts behind the models | USER: Chapter 1 |

Research questions and data | Lemma Module 8 |

Single level multiple regression models | Lemma Module 3 |

The basic two-level model | Lemma Module 5 |

Web resources for multilevel modelling | Links to non-CMM resources |

Getting started with MLwiN (without modelling) | C&Hvol1: Chapter 2 |

## Hierarchical normal-theory models

### Two-level hierarchical model with a continuous response

The basic models | Lemma Module 5USER: Chapter 2 |

Residuals | USER: Chapter 3Slides with voiceover |

Random intercepts and random slopes | USER: Chapter 4Slides; slides with voiceover |

Customised (AKA out of sample) predictions | SUPP: Chapter 2 and Appendix A |

Comparing a sequence of models &testing | C&Hvol1: Chapter 6SUPP: Chapter 4 |

Diagnostics | USER: Chapter 15C&Hvol1: Chapter 4 |

Variance functions | USER: Chapter 7 |

Power point slides: introduction to multilevel models | Slides |

Multilevel Statistical Models by Harvey Goldstein | MSM Script |

Intro Multilevel Modelling, by Kreft and de Leeuw | IMM Script |

Multilevel modelling by Snijders and Bosker | B&Adv Script 2nd edition |

### Contextual variables at level two

Contextual effects and cross-level interactions | USER: Chapter 6C&Hvol1: Chapter 8 |

Customised predictions plot | SUPP: Chapter 2 and Appendix A |

### Going further with the basic model

Partitioning variance | VPC |

Estimation by MCMC | C&Hvol1: Chapter 10MCMC: Chapter 1 to 6 |

Complex heterogeneity at level 1 with MCMC | MCMC: Chapter 9 |

Robust or sandwich errors | FAQRobust |

FAQ's ICC | FAQICC |

FAQ's residuals | FAQ Res |

Survey weights | FAQWts |

### Three-level models

Concepts | Lemma Module 4 |

Specification, estimation, interpretation | Lemma Module 11 |

Repeated cross-sectional model | C&Hvol1: Chapter 11 |

## Models with multiple responses (including multivariate and panel models)

### Multivariate response models

Concepts | Lemma Module 4 |

Multivariate normal response models | USER: Chapter 14 |

Estimation in MCMC | MCMC: Chapter 18 |

Customised predictions | SUPP: Chapter 2.5 and Appendix A |

Estimation in MCMC | MCMC: Chapter 18 |

### Repeated measures (panel models)

Concepts | C&Hvol2: Chapter 14; Lemma Module 15 |

Models for repeated measures | USER: Chapter 13; Lemma Module 15 |

Presentation | Multilevel models for longitudinal data (PDF, 370kB) |

Application | Physical Health functioning (PDF, 933kB) |

Modelling longitudinal and cross-sectional effects | C&Hvol2: Chapter 15 |

Applied Longitudinal by Singer and Willett | ALDA Script |

Ordinal categories for time | SUPP: Chapter 2 |

Auto-correlated errors in continuous time | SUPP: Chapter 5 |

As a multivariate model | MCMC: Chapter 18 |

With autoregressive structure | MCMC: Chapter 18 |

FAQ's | Longitudinal data FAQs |

Event history | Multilevel discrete-time event history |

### Multilevel factor analysis

Estimation in MCMC | MCMC: Chapter 20 |

Multilevel structural equation models | REALCOM |

## Discrete outcomes

### Bernoulli or binomial responses: binary or proportions

Concepts | Lemma Modules 6 & 7 |

Quasi-likelihood estimation | USER: Chapter 9 |

Modelling proportions (binomial counts) | USER: Chapter 9.5C&Hvol2: Chapter 12 |

MCMC estimation | MCMC: Chapter 10 |

Customised predictions | SUPP: Chapter 2.2 and Appendix A |

Comparing a sequence of models | SUPP: Chapter 4 |

Partitioning variance | VPC |

PowerPoint presentation on discrete models | Slides |

Applications | Multilevel Gallery |

FAQ's | Discrete FAQ's |

Modelling segregation | Modelling ethnic segregation using MLwiN (PDF, 972kB) |

### Nominal responses: multiple categories unordered

Concepts | Lemma Module 10 |

Quasi-likelihood estimation | USER: Chapter 10 |

MCMC estimation | MCMC: Chapter 12 |

Customised predictions | SUPP: Chapter 2.3 and Appendix A |

Comparing a sequence of models | SUPP: Chapter 4 |

PowerPoint presentation | Slides |

Applications | Multilevel Gallery |

FAQ's | Discrete FAQ's |

Modelling segregation | Modelling ethnic segregation using MLwiN (PDF, 972kB) |

### Ordinal responses: multiple categories ordered

Concepts | Lemma Module 9 |

Quasi-likelihood estimation | USER: Chapter 11 |

MCMC estimation | MCMC: Chapter 13 |

Customised predictions | SUPP: Chapter 2.3 and Appendix A |

Comparing a sequence of models | SUPP: Chapter 4 |

Powerpoint presentation | Slides |

Applications | Multilevel Gallery |

FAQ's | Discrete FAQ's |

### Poisson and Negative Binomial Models: counts and rates

Concepts | C&Hvol2: Chapter 13 |

Quasi-likelihood estimation | USER: Chapter 12 |

MCMC estimation | MCMC: Chapter 11 |

Customised predictions | SUPP: Chapter 2.4 and Appendix A |

Comparing a sequence of models | SUPP: Chapter 4 |

Powerpoint presentation | Slides |

Applications | Multilevel Gallery |

FAQ's | Discrete FAQ's |

### Multivariate mixed response models

Discrete & continuous outcomes simultaneously | MCMC: Chapter 18 |

Estimation in REALCOM | REALCOM |

Responses at more than one level & of different type | REALCOM Stat – JR |

## Non-Hierarchical models

### Cross- classified models

Concepts | Lemma Module 4Lemma Module 12 |

Estimation in MCMC | MCMC: Chapter 15 |

Comparing a sequence of models | SUPP: Chapter 4 |

Applications | Multilevel Gallery |

### Multiple membership models

Concepts | Lemma Module 4Lemma Module 13 |

Estimation in MCMC | MCMC: Chapter 16 |

Comparing a sequence of models | SUPP: Chapter 4 |

Applications | Multilevel Gallery |

### Spatial models

Concepts | C&Hvol2: Chapter 16 |

Estimation in MCMC | MCMC: Chapter 17 |

Space-time models | C&Hvol2: Chapter 16 |

## Estimation

### IGLS (maximum likelihood estimation) algorithm

Underlying concepts | C&Hvol1: Chapter 9 |

Commands for the IGLS algorithm | COMMAND: Chapter 13 |

Constraining parameters | FAQ Constraint |

### MCMC estimation

Bayesian approach and MCMC estimation | MCMC: Chapter 1C&Hvol1: Chapter 10 |

Fixed and random effects estimated by MCMC | MCMC: Chapter 3.3 |

Simulation in MLwiN | USER: Chapter 16 |

Gibbs sampling for MCMC and DIC | MCMC: Chapter 1 to 3 |

Metropolis Hastings sampling | MCMC: Chapter 1 to 4 |

Using prior distributions | MCMC: Chapter 5 |

Speeding up (less correlated chains) | MCMC: Chapter 21-c25 |

Speeding up (less correlated chains) | C&Hvol1: Chapter 10 and C&Hvol2: Chapter 12 |

MCMC FAQs | FAQ MCMC |

Commands for MCMC estimation | COMMAND: Chapter 16 |

### Bootstrap estimation

Iterated and non-parametric bootstrap | USER: Chapter 16 |

### Estimates of residuals and shrinkage

Fix e d and random effects | USER: Chapter 2C&Hvol1: Chapter 2 |

Residuals and shrinkage | USER: Chapter 9 |

## Data and design

### Missing data

Concepts | Lemma Module 14http://www.missingdata.org.uk |

Estimation in MCMC | MCMC: Chapter 18 |

Multiple imputation in REALCOM | REALCOM |

Multiple imputation in Stat-JR | Multiple imputation for 2-level models in Stat-JR |

Getting data in (with missing) | FAQ data in |

Identifying patterns of missingness | FAQ Pat Miss (PDF, 381kB) |

### Measurement error

Measurements error and misclassification | MCMC: Chapter 14 |

Measurement error modelling | REALCOM |

### Power calculations

Concepts | FAQ Power |

Sample size | Size |

Concepts and software | MLPowSim |

## MLwiN functioning

### Data and worksheets

Chapter 2

Research questions and data | Lemma Module 8 |

Getting started with data | USER: Chapter 8 |

Viewing data | SUPP: Chapter 8 |

Getting started with MLwiN (without modelling) | C&Hvol1: |

Getting data in to MLwiN | FAQ data in |

Getting data out of MLwiN | FAQ dataout |

Understanding worksheets | C&Hvol1: Chapter 2 |

Increasing worksheet size | FAQ Inc Size |

Large data sets | FAQ Large |

Getting data from other software | SUPP: Chapter 6 |

Minitab, Stata and SPSS | FAQ Other packages |

Categorical variables reference categories | SUPP: Chapter 8 & 1FAQ Categ |

Categorical variables: ordinal categories | SUPP: Chapter 2 |

Combining categorical columns | SUPP: Chapter 8 |

Finding unique codes | SUPP: Chapter 8 |

### Graphs

Graphs | USER: Chapter 5 |

Graphs of residuals | USER: Chapter 3 |

Graphs of group lines | USER: Chapter 4 |

High- resolution graphics | C&Hvol1: Chapter 2http://www.gigasoft.com/ |

Customised predictions plot | SUPP: Chapter 2 and Appendix A |

3D graphs | SUPP: Chapter 3 |

### Simulation studies

Simulation | USER: Chapter 16 |

Running a simulation study | MCMC: Chapter 8 |

Commands for simulation | COMMAND: Chapter 20 |

### Commands, syntax and macros

Guide to using syntax | C&Hvol1: Chapter 1COMMAND: Chapter 1 |

Quick reference sheet for commands | Command dictionary (PDF, 47kB) |

Quick introduction to commands and macros | Introduction to commands (PDF, 33kB) |

FAQ on commands | FAQ syntax |

An example of a macro | C&Hvol1: Chapter 1 |

Macro commands | COMMAND: Chapter 15 |

Macro programming | SUPP: Chapter 4 |

FAQ on macros | FAQ macro |

Stored estimates | FAQ estimates |

Every documented command | COMMAND |

more recent commands | SUPP: all chapters |

Commands for the IGLS algorithm | COMMAND: Chapter 13 |

Commands for MCMC estimation | COMMAND: Chapter 16 |

### MLwiN and different operating systems

MLwiN system requirements | Frequently Asked Questions |

Mac, server etc | Frequently Asked Questions |

### MLwiN Bugs and errors

Bugs and errors during estimation | FAQ errors in estimation |

Implausible results | FAQ errors in estimation |

Problems opening worksheets | FAQ crashes |

## Interoperability: using MLwiN with other software

Stata | runmlwin: MLwiN from within Stata |

R | R2MLwiN: MLwiN from within R |

Stat-JR | Stat-JR: a software environment |

MLwiN to WinBUGS | MCMC: Chapter 7 |

## Other software and how it can be used with CMM materials

LEMMA training material in Stata | LEMMA |

LEMMA training material in R | LEMMA |

LEMMA training material in SPSS | LEMMA |

Examples of other multilevel software (some of these are out of date) |
CMM software reviews |

## Further training and information

Face to face workshops | Workshops |

Sign up for CMM Newsletter | Newsletter |