Chapter 1 About

This is a fictional scenario and data set designed for the sole purpose of illustrating the coding and interpretation of multiple membership models using the R2MLwiN package. These data were simulated by myself, and were designed to loosely resemble a population of college students at a university. These data were not actually gathered from students. This is designed to be tutorial-style, with background information about the models presented prior to walking through model building and output interpretation.

1.1 R packages used

Calculations and data manipulations performed in this tutorial made use of the following R packages: Bookdown (Xie (2023))
knitr (Xie (2022))
Rmarkdown (Allaire et al. (2022))
Tidyverse (Wickham (2021))
ggplot2 (Wickham et al. (2022))
misty (Yanagida (2023))
R2MLwiN (Zhang et al. (2023))

The software MLwiN, v3.06 (Charlton et al., n.d.) was also used, with Bayesian MCMC estimation (W. J. Browne 2022)

1.2 Acknowledgements

Much of the background information about multiple membership models was gathered from the learning resources provided by the University of Bristol’s Center for Multilevel Modelling ( (n.d.a)).

1.3 A Disclaimer

The data used in this tutorial were simulated by me, and I am certain that a better job could have been done to better reflect some dependencies that should be in the data. One known omission is variance components were not specified prior to estimating the outcome. However, these data were simulated to reflect a fictional student population to the best of my ability at the time and no intentional errors or misrepresentations were intended. Data-generating code is included in the Appendix.


Allaire, JJ, Yihui Xie, Jonathan McPherson, Javier Luraschi, Kevin Ushey, Aron Atkins, Hadley Wickham, Joe Cheng, Winston Chang, and Richard Iannone. 2022. Rmarkdown: Dynamic Documents for r.
Browne, W. J. 2022. MCMC Estimation in MLwiN V3.06. Centre for Multilevel Modelling, University of Bristol.
Charlton, C., J. Rasbash, W. J. Browne, M. Healy, and B. Cameron. n.d. MLwiN Version 3.06. Centre for Multilevel Modelling, University of Bristol.
Wickham, Hadley. 2021. Tidyverse: Easily Install and Load the Tidyverse.
Wickham, Hadley, Winston Chang, Lionel Henry, Thomas Lin Pedersen, Kohske Takahashi, Claus Wilke, Kara Woo, Hiroaki Yutani, and Dewey Dunnington. 2022. Ggplot2: Create Elegant Data Visualisations Using the Grammar of Graphics.
Xie, Yihui. 2022. Knitr: A General-Purpose Package for Dynamic Report Generation in r.
———. 2023. Bookdown: Authoring Books and Technical Documents with r Markdown.
Yanagida, Takuya. 2023. Misty: Miscellaneous Functions t. Yanagida.
Zhang, Zhengzheng, Chris Charlton, Richard Parker, George Leckie, and William Browne. 2023. R2MLwiN: Running MLwiN from Within r.