Lab 4 - Mediation

Structural Equation Modeling ED 216F - Instructor: Karen Nylund-Gibson

Adam Garber

April 24, 2020

Lab preparation

Creating a version-controlled R-Project with Github

Download repository here:

On the Github repository webpage:

  1. fork your own branch of the lab repository
  2. copy the repository web URL address from the clone or download menu

Within R-Studio:

  1. click “NEW PROJECT” (upper right corner of window)
  2. choose option Version Control
  3. choose option Git
  4. paste the repository web URL path copied from the clone or download menu on Github page
  5. choose location of the R-Project (too many nested folders will result in filepath error)

Lab outline

  1. Estimate a mediation model using the {mediation} package
  2. Estimate the same model using the Structural Equation Modeling (SEM) framework with {MplusAutomation}
  3. For the second empirical example, estimate parallel models using the mediation and SEM methods

A quick detour - Equivalent models