Online supplementary materials Mulder, Usami, Hamaker (2024)

Authors
Affiliations

Jeroen D. Mulder

Utrecht University

Satoshi Usami

Tokyo University

Ellen L. Hamaker

Utrecht University

Introduction

This website is the supplementary materials to “Joint effects in cross-lagged panel research using structural nested mean models” by Mulder, Usami, and Hamaker (2024). It contains:

  1. fully annotated R code for replicating analyses from the empirical example in the main paper;
  2. fully annotated R code to test if the modeling procedure in R works as intended using simulated data; and
  3. answers to Frequently Asked Questions (FAQ) that reach us via email.

Use the top menu to navigate to code for the empirical example, the test code, or the FAQ.

R packages

For the analyses, we relied on functions from the following R packages: foreign (version 0.8-83) by R core Team (2022); dplyr (version 1.1.4) by Wickham et al. (2023); tidyr (version 1.3.1) by Wickham, Vaughan, and Girlich (2024); purrr (version 1.0.2) by Wickham and Henry (2023); mice (version 3.16.0) by Buuren and Groothuis-Oudshoorn (2011); ggplot2 (version 3.4.4) by Wickham (2016); lavaan (version 0.6.16) by Rosseel (2012); geeM (version 0.10.1) by McDaniel, Henderson, and Rathouz (2013); and boot (version 1.3-28) by Canty and Ripley (2022). They can be loaded into an R session using the below code:

# Packages: Data 
library(foreign) # Read data stored by SPSS
library(dplyr) # Data wrangling
library(tidyr)
library(purrr)
library(mice)

# Packages: Visualization
library(ggplot2)

# Packages: Analyses
library(lavaan) # Structural equation modeling
library(geeM) # GEE
library(boot) # Bootstrap

References

Buuren, Stef van, and Karin Groothuis-Oudshoorn. 2011. “Mice: Multivariate Imputation by Chained Equations in R.” Journal of Statistical Software 45 (3): 1–67. https://doi.org/10.18637/jss.v045.i03.
Canty, A., and B. D. Ripley. 2022. “Boot: Bootstrap R (S-Plus) Functions.”
McDaniel, Lee S., Nicholas C. Henderson, and Paul J. Rathouz. 2013. “Fast Pure {R} Implementation of {GEE}: Application of the {M}atrix Package.” The {R} Journal 5 (1): 181–87. https://journal.r-project.org/archive/2013-1/mcdaniel-henderson-rathouz.pdf.
Mulder, Jeroen D., Satoshi Usami, and Ellen L. Hamaker. 2024. “Joint Effects in Cross-Lagged Panel Research Using Structural Nested Mean Models.” Structural Equation Modeling: A Multidisciplinary Journal. https://doi.org/https://doi.org/10.1080/10705511.2024.2355579.
R core Team. 2022. “Foreign: Read Data Stored by Minitab’, ’S’, ’SAS’, ’SPSS’, ’Stata’, ’Systat’, ’Weka’, ’dBase’, ...” https://CRAN.R-project.org/package=foreign.
Rosseel, Yves. 2012. “Lavaan: An R Package for Structural Equation Modeling.” Journal of Statistical Software 48 (2). https://doi.org/10.18637/jss.v048.i02.
Wickham, Hadley. 2016. Ggplot2: Elegant Graphics for Data Analysis. New York: Springer-Verlag. https://ggplot2.tidyverse.org.
Wickham, Hadley, Romain François, Lionel Henry, Kirill Müller, and Davis Vaughan. 2023. “Dplyr: A Grammar of Data Manipulation.” https://CRAN.R-project.org/package=dplyr.
Wickham, Hadley, and Lionel Henry. 2023. “Purrr: Functional Programming Tools.” https://CRAN.R-project.org/package=purrr.
Wickham, Hadley, Davis Vaughan, and Maximilian Girlich. 2024. “Tidyr: Tidy Messy Data.” https://CRAN.R-project.org/package=tidyr.