Leanpub Header

Skip to main content

Longitudinal Structural Equation Modelling

Model Stability, Causal Direction, and Individual Change in Panel Data Using R

Use panel data to study stability, causal direction and individual change with structural equation models in R. In this course, you will learn how to estimate autoregressive, cross-lagged, random-intercept cross-lagged and latent growth models with lavaan, test hypotheses by comparing nested models, and model non-linear change. You will finish with a clear, reproducible workflow for longitudinal SEM that you can apply to your own panel data.

Interested in this course? Show your support by saying what you'd like to pay for it!

$
PDF
EPUB
WEB
About

About

About the Course

Longitudinal data, or data collected multiple times from the same cases, lets us see how people change in time and which changes come first. Making use of this information requires models that follow the time order of the data. Structural equation modelling (SEM) is a flexible framework for this. It estimates several regressions at once, can include latent variables and random effects, and makes it easy to test hypotheses by comparing models.

This course will teach you how to use SEM to analyse panel data in R with 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 why people change at different rates.

Models are presented using path diagrams, equations and lavaan syntax, so you can see how the three fit together. You will learn how to estimate the models and interpret their coefficients. You will also use model comparisons to test research hypotheses, such as whether stability is the same from wave to wave or whether one variable has a stronger effect on the other.

The course focuses on the questions applied researchers often ask of panel data. These include how stable a characteristic is and which of two variables influences the other. They also include whether an effect works through a mediator and how individual trajectories differ. The examples use longitudinal survey data, mainly from Understanding Society, so the skills you learn transfer directly to your own research projects.

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:

  • How path analysis splits an effect into direct, indirect and total effects
  • What SEM adds to regression, such as latent variables and correction for measurement error
  • How SEM models are estimated (maximum likelihood and weighted least squares)
  • How to compare models using the chi-square test, AIC and BIC
  • How to model stability between two waves and interpret the stability coefficient
  • How to estimate three-wave autoregressive models with lag-2 effects or correlated errors
  • How to test whether stability is the same in time by constraining coefficients and comparing nested models

These models are the building blocks for the cross-lagged and latent growth models in the rest of the course.

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:

  • Specify a cross-lagged panel model with stability coefficients, cross-lagged effects and within-wave correlations
  • Test the causal direction by constraining the two cross-lagged effects to be equal
  • Test hypotheses about changes in stability, stationarity and equilibrium
  • Control for time-constant and time-varying confounders
  • Separate within-person and between-person variation with random intercepts (the random-intercept cross-lagged panel model)
  • Estimate longitudinal mediation models that control for earlier values of the mediator and the outcome

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:

  • How the latent growth model relates to the multilevel model for change
  • How to define the intercept and the slope using fixed loadings
  • How to estimate latent growth models in R with the growth() command
  • How to interpret the average trajectory, the differences between individuals and the correlation between the intercept and the slope
  • How to explain the starting level and the rate of change with time-constant predictors
  • When to use the latent growth model and when to use the multilevel model for change

This gives you a way to study individual change within the same SEM framework used for the autoregressive and cross-lagged models.

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:

  • Include time-varying covariates in a latent growth model
  • Estimate parallel process models for two outcomes that change together
  • Recognise an improper solution, such as a correlation above 1, and decide what to do about it
  • Move the intercept to a different wave by recoding the time loadings
  • Deal with missing waves and unequal gaps between waves
  • Model non-linear change using quadratic growth and freely estimated loadings
  • Build a sequence of models, from a linear trajectory to other shapes of change and then predictors

These extensions let you adapt the latent growth model to the shape of change and the design of your own study.

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 has a video and the slides as a PDF. 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. The data is provided already cleaned, with four waves in both wide and long format, so you can start modelling straight away. You will estimate autoregressive models of mental health and cross-lagged models of mental and physical health. You will also look at life satisfaction and mental health with random intercepts, and estimate latent growth models of income with time-constant and time-varying predictors.

Each practical includes:

  • Guided exercises with questions to answer
  • Full solution code, as a PDF and an R script
  • Detailed walkthrough videos

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 analyse longitudinal and panel data with structural equation models in R, including:

  • PhD students working with panel or cohort data
  • Social scientists who want to study causal direction and change with survey data
  • Health and behavioural researchers working with repeated measures
  • Researchers who know regression and want to move on to longitudinal SEM

Prerequisites

You should already be comfortable with:

  • Basic R syntax
  • Working with data frames and basic data manipulation
  • Linear regression

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 modelling 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:

  • Specify and estimate path models, autoregressive models and cross-lagged panel models in lavaan
  • Test hypotheses about stability and causal direction by comparing nested models
  • Use random intercepts to estimate within-person effects in a cross-lagged model
  • Estimate longitudinal mediation models
  • Fit and interpret latent growth models with time-constant and time-varying predictors
  • Model parallel processes, non-linear change and missing waves

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.

Share this course

Instructor

About the Instructor

Alexandru Cernat

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.

The Leanpub Podcast

Episode 267

An Interview with Alexandru Cernat

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...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

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

Free Updates. DRM Free.

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

Write and Publish on Leanpub

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.

Learn more about writing on Leanpub