R2MLwiN: Running MLwiN from within R

R2MLwiN is an R command interface to the MLwiN multilevel modelling software package, allowing users to fit multilevel models using MLwiN from within the R environment.


News


04 May 2016: A pre-print of R2MLwiN article available

If you wish to cite the article (available here), please do so as:

12 Apr 2016: The latest version of R2MLwiN (0.8-2) has been released on CRAN.

This includes the following new features (and also note bug fixes):

(For older news items, see the news archive).


Installation


Both MLwiN and R are required to use R2MLwiN. MLwiN is free to UK academics. A fully functional 30-day free version of MLwiN is available to all other users.

As R2MLwiN depends on a number of third party packages we suggest that before installing the package you run the command:

update.packages(repos = "http://cran.r-project.org")

to ensure that any you already have installed are up to date.

You can then install the package from CRAN with the following command:

install.packages("R2MLwiN", repos = "http://cran.r-project.org")

Alternatively a less tested development version, which will contain the most recent changes and bug fixes, can be installed with the following commands:

library(devtools)

install_github("rforge/r2mlwin", subdir="R2MLwiN")

To then load it, type:

library(R2MLwiN)


Documentation and Examples


Journal article

A pre-print of an upcoming article describing R2MLwiN is available here. If you wish to cite the article, please do so as:

Help files

As with all packages on CRAN, R2MLwiN comes with a number of help files; to see a list of the documentation available, type the following at the R command line:

help(package = "R2MLwiN")

The main command for calling MLwiN from R is called runMLwiN, and details of the syntax and options for this can be found with:

help(runMLwiN, package="R2MLwiN")

Demos

R2MLwiN also comes with a range of demos; these replicate all the analyses reported in the (IGLS) User's Guide to MLwiN and the MLwiN MCMC Manual. To see a list of these, type:

demo(package = "R2MLwiN")

To view the script of a specific demo (in this example the code replicating the analyses in Chapter 3 of the MLwiN MCMC Manual) type:

file.show(system.file("demo", "MCMCGuide03.R", package = "R2MLwiN"))

Finally, to run that demo, enter the following:

demo(MCMCGuide03)

These demos and their outputs can also be viewed on the Examples page.


Citations


Please cite R2MLwiN as follows:

We are happy to list all publications that cite R2MLwiN on this web site. More >>


Presentations


We gave a presentation on R2MLwiN at the 10th International Multilevel Conference in Utrecht (9th-10th April 2015). There's a pdf file below (converted from a Powerpoint file, with animations split courtesy of PPspliT):

Slides (PDF, 4.0mb)


User forum


Please use the R2MLwiN user forum to post any questions or feedback you have regarding R2MLwiN.

Acknowledgements


We are very grateful to colleagues at the Centre for Multilevel Modelling and the University of Bristol for their useful comments. This work is funded under the e-STAT node (Grant: RES-149-25-1084) as part of the ESRC Digital Social Research programme.