• Introduction to Multilevel Modelling
  • Welcome
    • About the Authors
    • Funding
  • 1 Introduction
    • 1.1 Overview
    • 1.2 Goals
    • 1.3 Prerequisites
    • 1.4 Materials
  • 2 Multiple Regression Review
    • 2.1 Learning Objectives
    • 2.2 Data Demonstration
      • 2.2.1 Creating R Projects
      • 2.2.2 Loading Data and Dependencies
      • 2.2.3 Simple Linear Regression
      • 2.2.4 Multiple Regression
      • 2.2.5 Interaction Terms
    • 2.3 Conclusion
  • 3 Approaches to Multilevel Data
    • 3.1 Learning Objectives
    • 3.2 Data Demonstration
      • 3.2.1 Load Data and Dependencies
      • 3.2.2 Dealing with Dependence
      • 3.2.3 Cluster-Robust Standard Errors
    • 3.3 Conclusion
    • 3.4 Further Reading
  • 4 Our First Multilevel Models
    • 4.1 Learning Objectives
    • 4.2 Data Demonstration
      • 4.2.1 Load Data and Dependencies
      • 4.2.2 Why Multilevel Models?
      • 4.2.3 Fixed vs Random Effects
      • 4.2.4 The Null Model
      • 4.2.5 Understanding Variance
    • 4.3 Conclusion
  • 5 Adding Fixed Predictors to MLMs
    • 5.1 Learning Objectives
    • 5.2 Data Demonstration
      • 5.2.1 Load Data and Dependencies
      • 5.2.2 MLM with Level-1 Predictor
      • 5.2.3 Compare Regular and Multilevel Regression
      • 5.2.4 MLM with Level-2 Predictor
    • 5.3 Conclusion
  • 6 Random Effects and Cross-level Interactions
    • 6.1 Learning Objectives
    • 6.2 Data Demonstration
      • 6.2.1 Load Data and Dependencies
      • 6.2.2 MLM with Random Slope Effect
      • 6.2.3 MLM with Crosslevel Effect
    • 6.3 Conclusion
  • 7 Model Estimation Options, Problems, and Troubleshooting
    • 7.1 Learning Objectives
    • 7.2 Data Demonstration
      • 7.2.1 Load Data and Dependencies
      • 7.2.2 Introduction to Estimation Problems
      • 7.2.3 Estimation and Optimizers
      • 7.2.4 Non-Convergence
      • 7.2.5 Singularity
      • 7.2.6 Deviance Testing for Model Comparison
    • 7.3 Conclusion
    • 7.4 Further Reading
  • 8 Centering Options and Interpretations
    • 8.1 Learning Objectives
    • 8.2 Data Demonstration
      • 8.2.1 Load Data and Dependencies
      • 8.2.2 Why Center Variables?
      • 8.2.3 Within, Between, and Contextual Effects
      • 8.2.4 Options for Centering in MLMs
      • 8.2.5 What Kind of Centering Should You Use?
    • 8.3 Conclusion
    • 8.4 Further Reading
  • 9 Multilevel Modelling with Repeated Measures Data
    • 9.1 Learning Objectives
    • 9.2 Data Demonstration
      • 9.2.1 Load Dependencies
      • 9.2.2 Review of Multilevel Modelling Procedure
      • 9.2.3 Multilevel Models for Repeated Measures
      • 9.2.4 Our Data: Reaction Time
      • 9.2.5 Random-Intercept-Only/Null Model
      • 9.2.6 Adding Level-1 Fixed Effects
      • 9.2.7 Adding Random Slopes
      • 9.2.8 Adding Level-2 Fixed Effects
      • 9.2.9 Adding Cross-Level Interactions
    • 9.3 Conclusion
  • 10 Multilevel Modelling with Longitudinal Data
    • 10.1 Learning Objectives
    • 10.2 Data Demonstration
      • 10.2.1 Load Dependencies
      • 10.2.2 Multilevel Models for Longitudinal Data
      • 10.2.3 Visualizing Testosterone Levels Over Time
      • 10.2.4 Random-Intercept-Only/Null Model
      • 10.2.5 Adding Level-1 Fixed and Random Effects
      • 10.2.6 Evidence for Retaining Effects
      • 10.2.7 Adding Level-2 Fixed Effects
    • 10.3 Conclusion
    • 10.4 Further Reading
  • 11 Effect Sizes in Multilevel Models
    • 11.1 Learning Objectives
    • 11.2 Data Demonstration
      • 11.2.1 Load Data and Dependencies
      • 11.2.2 Defining Effect Sizes
      • 11.2.3 R-squared in Multilevel Models
      • 11.2.4 Single Model, Automatic Entry
      • 11.2.5 Single Model, Manual Entry
      • 11.2.6 Model Comparison
    • 11.3 Conclusion
    • 11.4 Additional Reading
  • 12 Assumptions
    • 12.1 Learning Objectives
    • 12.2 Data Demonstration
      • 12.2.1 Load Data and Dependencies
      • 12.2.2 Assumptions of MLMs
      • 12.2.3 Assumption 1: Model Specification
      • 12.2.4 Assumption 2: Functional Form is Correct
      • 12.2.5 An Aside: Extracting Residuals
      • 12.2.6 Assumption 3: Level-1 Residuals are Independent and Normally Distributed
      • 12.2.7 Assumption 4: Level-2 Residuals are Independent and Multivariate Normal
      • 12.2.8 Assumption 5: Residuals at Level-1 and Level-2 are Independent
      • 12.2.9 Assumption 6: Level-1 Residuals Independent of Level-2 Predictors, Level-2 Residuals Independent of Level-1 Predictors
    • 12.3 Conclusion
    • 12.4 Further Reading
  • Appendix
  • A Download Materials
  • Mairead Shaw
  • Jessica Kay Flake

Introduction to Multilevel Modelling

A Download Materials

Chapter Data R Script Worksheet
2 heck2011.csv 02-multiple-regression.R Linear Regression Review
3 heck2011.csv 03-module-3.R Approaches to Multilevel Data
4 heck2011.csv 04-module-4.R Our First MLM: The Null Model
5 heck2011.csv 05-module-5.R Adding Fixed Predictors
6 heck2011.csv 06-module-6.R Random Effects and Cross-level Interactions
7 heck2011.csv 07-module-7.R Estimation Options and Troubleshooting
8 heck2011.csv 08-module-8.R Centering
9 hoffman2007.csv 09-module-9.R Repeated Measures
10 casto2016.csv 10-module-10.R Longitudinal Measures
11 teachsat.csv 11-module-11.R Effect Sizes in MLMs
12 rb2002.csv 12-module-12.R Assumptions