r2mlm: An R package calculating R-squared measures for multilevel models
Related Experiment Video
Updated: Sep 5, 2025

Constructing and Visualizing Models using Mime-based Machine-learning Framework
Published on: July 22, 2025
Mairead Shaw1, Jason D Rights2, Sonya S Sterba3
1Department of Psychology, McGill University, 2001 McGill College, 7th Floor, Montreal, QC, H3A 1G1, Canada. mairead.shaw@mail.mcgill.ca.
Abstract:
Multilevel models are used ubiquitously in the social and behavioral sciences and effect sizes are critical for contextualizing results. A general framework of R-squared effect size measures for multilevel models has only recently been developed. Rights and Sterba (2019) distinguished each source of explained variance for each possible kind of outcome variance. Though researchers have long desired a comprehensive and coherent approach to computing R-squared measures for multilevel models, the use of this framework has a steep learning curve. The purpose of this tutorial is to introduce and demonstrate using a new R package - r2mlm - that automates the intensive computations involved in implementing the framework and provides accompanying graphics to visualize all multilevel R-squared measures together. We use accessible illustrations with open data and code to demonstrate how to use and interpret the R package output.
Related Concept Videos
Response Surface Methodology
The process of RSM involves several key steps:
Calculating and Interpreting the Linear Correlation Coefficient
Introduction to R
Multiple Regression
Farmers can use multiple regression to determine the crop yield based on more than one factor, such as water availability, fertilizer, soil properties, etc. Here, the crop yield is the response or dependent variable as it depends on the other independent variables. The analysis requires the construction of a scatter plot...
Friedman Two-way Analysis of Variance by Ranks
Calibration Curves: Correlation Coefficient

