The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms...

In this track, you will learn everything you need to run your own longitudinal analysis. It covers the core skills you need, from preparing longitudinal data to the most common research models: fixed effects, random effects, multilevel models for change, cross-lagged models, latent growth models, and survival analysis.
Minimum price
$499
$499
About the Track
Longitudinal data, or data collected multiple times from the same cases, let you study how people change over time, causal relationships, and events. Using this information requires two sets of skills. You have to prepare complex panel data and work with complex statistical models that fit your research question.
This track brings together four courses that cover both these skills. The track starts with Master Longitudinal Data Wrangling using R. In this course, you will learn how to select, recode, merge, and reshape panel data, so you can move from messy raw files to analysis-ready data with a clear and reproducible workflow.
Fixed, Random and Multilevel Models for Change then discusses how to use the two sources of variation in longitudinal data, between and within individuals, to estimate better causal relationships and look at individual-level change. In this course, you will estimate fixed effects, random effects, and hybrid models, and build multilevel models for change, including time-varying predictors and non-linear change.
Longitudinal Structural Equation Modelling will teach you how to use SEM to study stability, causal direction, and individual change. You will estimate cross-lagged, random-intercept cross-lagged, and latent growth models, and test your hypotheses by comparing models.
Finally, Survival Analysis looks at whether and when events happen. You will learn how to deal with censoring, build life tables and estimate discrete-time hazard models, Kaplan-Meier curves and Cox regression.
Across the four courses, learning is hands-on. Each course combines short video lessons, quizzes, and practical exercises with full solution code. Most of the practicals use a synthetic version of Understanding Society, one of the largest household panel studies in the world, so the skills you learn transfer directly to your own research.
By completing this track, you will be able to:
This track is designed for PhD students, researchers and data analysts in the social, behavioural and health sciences who work with panel, cohort or other repeated-measures data. You should already know basic R and linear regression. If you are new to R, consider taking Introduction to R for Social Researchers first.
Verified Certificate
When you successfully complete the Track, you will receive a verified Certificate of Completion from Leanpub, certifying that you have completed the entire Track.

Courses Included
Longitudinal datasets are one of the most powerful sources of evidence in the social sciences. They allow researchers to study how individuals, organisations, and societies change over time. However, working with longitudinal data can quickly become overwhelming. Multiple waves, inconsistent variable names, missing data, and complex data structures make longitudinal data wrangling one of the biggest challenges researchers face.
This course will teach you how to efficiently clean, reshape, and prepare longitudinal datasets using R so you can move from messy raw data to analysis-ready datasets with confidence.
Instead of spending weeks struggling with merging waves, restructuring panel data, or fixing variable coding, you will learn a clear and reproducible workflow for longitudinal data wrangling in R. By the end of the course, you will know how to prepare complex panel datasets for statistical analysis while writing clean, reusable code.
The course focuses on practical data wrangling techniques used by researchers working with longitudinal and panel data, including selecting variables, recoding data, merging waves, reshaping datasets, handling missing values, and automating repetitive data preparation tasks.
All examples use realistic longitudinal survey data, so the skills you learn transfer directly to your own research projects.
Understanding longitudinal data structures
Before cleaning data, it is essential to understand how longitudinal datasets are organised.
In this section, you will learn the key concepts behind longitudinal and panel data, including:
Understanding these concepts will help you design better workflows for longitudinal data preparation and analysis.
Cleaning longitudinal datasets often requires a combination of several data manipulation steps.
In this section, you will learn how to perform essential data wrangling tasks in R, including:
These tools form the foundation for efficient data-cleaning workflows for panel and longitudinal data.
One of the most common challenges in longitudinal research is combining data across waves and restructuring datasets into formats suitable for analysis.
In this section, you will learn how to:
These are core skills for anyone working with panel data, repeated measures datasets, or cohort studies.
Longitudinal projects often involve repeating the same data preparation steps across many waves.
Instead of copying and modifying code manually, you will learn how to automate data wrangling tasks in R, including:
These techniques allow you to handle complex datasets while keeping your code clean, efficient, and reproducible.
The course combines videos, written explanations, quizzes, and hands-on practical exercises so you learn by applying the techniques directly. You will also gain access to a forum to ask questions related to the topics covered in the class.
The practical exercises use a synthetic version of Understanding Society (UKHLS), one of the largest longitudinal household surveys in the world. You will prepare multiple waves of the dataset, clean variables, reshape the data, and explore patterns across time.
The practical includes:
By the end of the course, you will have built a complete workflow for preparing longitudinal data in R that you can adapt to your own datasets.
This course is designed for researchers who want to become confident working with longitudinal and panel data in R, including:
You should already be comfortable with:
If you are new to R, consider taking the course Introduction to R for Social Researchers, which provides the foundations needed to follow the workflows taught here.
After completing the course, you will be able to:
Most importantly, you will gain a clear workflow for longitudinal data wrangling, allowing you to focus on answering research questions rather than fighting with messy data.
Longitudinal data, or data collected multiple times from the same cases, makes it possible to study how people change in time and why some people change more than others. This also brings a challenge. Each person is measured repeatedly, so the variation in the data has two sources: differences between people and changes within the same person.
This course will teach you the main regression-based models for this type of data and how to estimate them in R. You will start with fixed effects, random effects and hybrid models, which are useful when the main interest is in causal relationships. You will then learn the multilevel model for change. This model describes how people change in time, how much they differ in their starting point and rate of change, and what explains these differences.
The course focuses on the decisions you have to make when modelling change. These include which source of variation to model, whether to use fixed or random effects and how to code time. They also include how to add predictors that change in time and how to model change that is not linear.
The lectures and practicals use data from Understanding Society, a large UK household panel study, and all the models are estimated in R with the plm and lme4 packages. This way, the skills you learn transfer directly to your own research projects.
What You Will Learn
Within and between variation
Before modelling change, it helps to understand where the variation in longitudinal data comes from.
In this section, you will learn:
These concepts are the basis for every model in the course.
Fixed, random and hybrid models
When the main interest is in causal relationships and change in time is not the main focus, fixed and random effects models are a good place to start.
In this section, you will learn how to:
In the first practical, you will apply these models to explain log income.
The multilevel model for change
The multilevel model for change describes the average change in time and how much people differ from it.
In this section, you will learn how to:
These steps give you a sequence of models you can use to describe and explain change in your own data.
Extending the multilevel model for change
Many research questions involve predictors that change in time and trajectories that are not straight lines.
In this section, you will learn how to:
With these extensions, you can adapt the multilevel model for change to the research questions and data in your own projects.
Learn by doing with real longitudinal data
The course combines videos, written explanations, quizzes, and hands-on practical exercises so you learn by applying the techniques directly. You will also gain access to a forum to ask questions related to the topics covered in the class.
The lectures help you gain hands on experince by applying what you learned to Understanding Society (UKHLS), one of the largest longitudinal household surveys in the world.
Each practical includes:
By the end of the course, you will have run a full sequence of fixed effects, random effects and multilevel models for change in R. You can then adapt the same code to your own panel data.
Who this course is for
This course is designed for researchers who want to model change with longitudinal and panel data in R, including:
Prerequisites
You should already be comfortable with:
The course data is already cleaned and in long format. If you want to learn how to clean, merge and reshape panel data yourself, consider taking the course Master Longitudinal Data Wrangling using R.
If you are new to R, consider taking the course Introduction to R for Social Researchers, which provides the foundations needed to follow the workflows taught here.
What you will be able to do after this course
After completing the course, you will be able to:
You will also have a clear order for building models of change, from the empty model to models with predictors, that you can follow with your own panel data.
Longitudinal data, or data collected multiple times from the same cases, let us see how people change over time and allow us to better understand causal relationships. Using this information requires flexible models that can account for its complexity. Structural equation modeling (SEM) is a framework that helps researchers understand change and multiple relationships at the same time. It estimates several regressions at once, can include latent variables and random effects, and makes it easy to test complex hypotheses.
This course will teach you how to use SEM to analyze longitudinal data in R using the lavaan package. We start with path analysis and simple models of stability. We then move on to cross-lagged panel models for questions about causal direction. Finally, we use latent growth models to estimate individual trajectories and explain how people change.
What You Will Learn
Path analysis, SEM and simple models of change
Structural equation models build on regression, so the course starts by estimating several regression equations at once.
In this section, you will learn:
Cross-lagged panel models
Many research questions are about which variable comes first, for example, whether poor physical health lowers mental health or the other way around.
In this section, you will learn how to:
We also discuss the main limitations of the cross-lagged model, so you can interpret its results with care.
The latent growth model
Latent growth models describe how each individual changes in time and what explains differences in that change.
In this section, you will learn:
Flexible latent growth models
Change in time does not always follow a straight line, and many panel studies have missing or unequally spaced waves.
In this section, you will learn how to:
Learn by doing with real longitudinal data
The course combines videos, written explanations, quizzes, and hands-on practical exercises so you learn by applying each model to data. Each lesson includes videos and accompanying slides. You will also gain access to a forum to ask questions related to the topics covered in the course.
There is a practical at the end of each module. The practicals use a synthetic version of Understanding Society (UKHLS), one of the largest longitudinal household surveys in the world. This provides an opportunity to implement what you have learned to help you transfer this to your own research.
Each practical includes:
You will finish the course with R code for each type of model that you can adapt to your own panel data.
Who this course is for
This course is designed for researchers who want to analyze longitudinal and panel data with structural equation models in R, including:
Prerequisites
You should already be comfortable with:
No previous knowledge of SEM or lavaan is needed, as the first module introduces both.
If you are new to R, consider taking the course Introduction to R for Social Researchers, which provides the foundations needed to follow the code taught here.
The practicals start from a cleaned dataset, so you do not need to prepare the data yourself. If you want to learn how to clean, merge, and reshape panel data before modeling it, the course Master Longitudinal Data Wrangling using R covers these steps.
For a longer introduction to path analysis and mediation with lavaan, see the course Mediation and Moderation Analysis using R. Taking it first is optional.
What you will be able to do after this course
After completing the course, you will be able to:
Most importantly, you will be able to choose the longitudinal SEM that fits your research question and explain what its coefficients say about stability and change.
Many questions we ask with longitudinal data concern events. Do people experience an event, such as finding a partner, leaving a job, or dropping out of a study? When does it happen? And what explains who experiences the event and when? Survival analysis, also known as event history analysis, is the set of methods developed to answer these questions.
Analyzing events is difficult because of censoring. In most studies, some people have not experienced the event by the time the study ends, while others leave before we can observe it. If we simply drop these cases, the results are biased towards the people who experience the event quickly.
This course will teach you how to analyze the occurrence and timing of events using R, from the life table to discrete-time hazard models and Cox regression.
The course starts with the main concepts: censoring, life tables, and hazard and survival functions. It then moves to discrete-time hazard models, which treat time in waves, years, or grades and can be estimated as logistic regressions on person-period data. Finally, it covers continuous-time methods, the Kaplan-Meier estimator and the Cox model, and how to test the proportionality assumptions behind both model types. In the process, you will learn to use the survival package, glm(), and the tidyverse to estimate, visualize, and interpret these models.
What You Will Learn
Key concepts of event occurrence
Before modeling events, we need to define exactly what we are studying and how to handle people for whom we never see the event.
In this section, you will learn the main concepts behind survival analysis, including:
Discrete-time hazard models
In panel studies, time is usually measured in waves, years, or school grades, so we only know the period in which an event happened.
In this section, you will learn how to:
Continuous-time survival models
When time is measured precisely, for example in days, very few people share the same event time and the life table no longer works.
In this section, you will learn how to:
Learn by doing with real longitudinal data
The course combines videos, written explanations, quizzes, and hands-on practical exercises so you learn by applying the techniques directly. You will also gain access to a forum to ask questions related to the topics covered in the class.
In the first practical, you will use 15 waves of a synthetic extract of the British Household Panel Survey (BHPS) to study how long it takes people who are single to find a partner. You will create the event, time, and censoring variables, build a life table, and code the risk set. You will then compare discrete-time hazard models with different ways of modeling time and with predictors such as gender, age, and income. In the second practical, you will use the re-arrest data from Singer and Willett’s Applied Longitudinal Data Analysis. You will estimate Kaplan-Meier curves and Cox models and test the proportional hazards assumption. A bonus section introduces recurrent events, using a clinical trial dataset that comes with the survival package.
The practicals include:
By the end of the course, you will have a complete workflow for analyzing time-to-event data in R that you can adapt to your own datasets.
Who this course is for
This course is designed for researchers who want to study the occurrence and timing of events using R, including:
Prerequisites
You should already be comfortable with:
If you are new to R, consider taking the course Introduction to R for Social Researchers, which provides the foundations needed to follow the workflows taught here. The first practical starts from data in long format and creates the event and time variables. If you want to learn how to merge, reshape, and clean panel data in more depth, take the course Master Longitudinal Data Wrangling using R. If you need a refresher on logistic regression, the chapter on regression models in the book Longitudinal Data Analysis Using R covers it. You do not need to know multilevel or structural equation models to follow this course.
What you will be able to do after this course
After completing the course, you will be able to:
About the Instructor
Alexandru Cernat is a professor in Methodology and Social Data Science at the University of Manchester.
He has a PhD in survey methodology from the University of Essex and was a post-doc at the National Centre for Research Methods and the Cathie Marsh Institute.
His research and teaching focus on: survey methodology, longitudinal data, measurement error, latent variable modelling, new forms of data and missing data.
He is also the founder of longitudinalanalysis.com, a platform that helps researchers and analysts learn to collect, clean, and analyse longitudinal data.
You can find out more about him and his research at: alexcernat.com.
Episode 267
An Interview with Alexandru Cernat
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms...
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
Learn more about writing on Leanpub
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them
You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!
Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.
Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.