Skip to main content
HomeR

Course

Hierarchical and Mixed Effects Models in R

AdvancedSkill Level
4.6+
163 reviews
Updated 01/2026
In this course you will learn to fit hierarchical models with random effects.
Start Course for Free
RProbability & Statistics4 hr13 videos55 Exercises4,750 XP22,857Statement of Accomplishment

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.

Loved by learners at thousands of companies

Group

Training 2 or more people?

Try DataCamp for Business

Course Description

This course begins by reviewing slopes and intercepts in linear regressions before moving on to random-effects. You'll learn what a random effect is and how to use one to model your data. Next, the course covers linear mixed-effect regressions. These powerful models will allow you to explore data with a more complicated structure than a standard linear regression. The course then teaches generalized linear mixed-effect regressions. Generalized linear mixed-effects models allow you to model more kinds of data, including binary responses and count data. Lastly, the course goes over repeated-measures analysis as a special case of mixed-effect modeling. This kind of data appears when subjects are followed over time and measurements are collected at intervals. Throughout the course you'll work with real data to answer interesting questions using mixed-effects models.

Prerequisites

Generalized Linear Models in R
1

Overview and Introduction to Hierarchical and Mixed Models

The first chapter provides an example of when to use a mixed-effect and also describes the parts of a regression. The chapter also examines a student test-score dataset with a nested structure to demonstrate mixed-effects.
Start Chapter
2

Linear Mixed Effect Models

3

Generalized Linear Mixed Effect Models

This chapter extends linear mixed-effects models to include non-normal error terms using generalized linear mixed-effects models. By altering the model to include a non-normal error term, you are able to model more kinds of data with non-linear responses. After reviewing generalized linear models, the chapter examines binomial data and count data in the context of mixed-effects models.
Start Chapter
4

Repeated Measures

This chapter shows how repeated-measures analysis is a special case of mixed-effect modeling. The chapter begins by reviewing paired t-tests and repeated measures ANOVA. Next, the chapter uses a linear mixed-effect model to examine sleep study data. Lastly, the chapter uses a generalized linear mixed-effect model to examine hate crime data from New York state through time.
Start Chapter
Hierarchical and Mixed Effects Models in R
Course
Complete

Earn Statement of Accomplishment

Add this credential to your LinkedIn profile, resume, or CV
Share it on social media and in your performance review
Enroll Now

Don’t just take our word for it

*4.6
from 163 reviews
72%
25%
4%
0%
0%
  • Clayton
    2 days ago

  • Adam
    last week

  • Sofia Esther
    2 weeks ago

  • Jacob
    2 weeks ago

  • Stan
    2 weeks ago

  • Jose Enrique
    3 weeks ago

Sofia Esther

Jacob

Jose Enrique

FAQs

What types of mixed-effects models does this course teach?

You will learn linear mixed-effect regressions, generalized linear mixed-effect regressions for binary and count data, and repeated-measures analysis as a special case of mixed-effect modeling.

How advanced is this course and what prior knowledge do I need?

This is an advanced course requiring knowledge of linear regression, generalized linear models, ggplot2, dplyr, and basic R programming. It has nine prerequisite courses.

Does the course use real datasets for the exercises?

Yes. You will work with real data throughout the course to answer interesting questions using mixed-effects models, applying what you learn to practical scenarios.

Will I learn when to use a random effect versus a fixed effect?

Yes. The course begins by reviewing slopes and intercepts in linear regressions before explaining what random effects are and how to decide when to use them.

How long does this course typically take to finish?

The course has 4 chapters and 55 exercises. The median completion time is about 3.85 hours, though individual pace may vary.

Join over 19 million learners and start Hierarchical and Mixed Effects Models in R today!

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.

Grow your data skills with DataCamp for Mobile

Make progress on the go with our mobile courses and daily 5-minute coding challenges.