Skip to contents

CRAN status CRAN RStudio mirror downloads lifecycle R-CMD-check Contributor Covenant

A tidy workflow for generating, estimating, reporting, and plotting structural equation models using ‘lavaan’, ‘OpenMx’, or ‘Mplus’. Throughout this workflow, elements of syntax, results, and graphs are represented as ‘tidy’ data, making them easy to customize. Includes functionality to estimate latent class analyses, and to plot ‘dagitty’ and ‘igraph’ objects.

The tidySEM package offers the following functionality:

  • Generate SEM model syntax in a top-down, tidy way, regardless of what software is used to estimate it
  • Tabulate model output in a publication-ready, uniform manner,
  • Make easily customizable graphs for SEM-models,
  • Estimate latent class analyses / mixture models in OpenMx

These functions are designed with the tidy tools manifesto (Wickham, last updated 23-11-2019) in mind, and interface with the existing suite of packages in the tidyverse.

Installation

You can install the public release of tidySEM from CRAN with:

install.packages("tidySEM")

You can install the development version of metamixture from GitHub with:

# install.packages("pak")
pak::pak("cjvanlissa/tidySEM")

Documentation

Every user-facing function in the package is documented, and the documentation can be accessed by running ?function_name in the R console, e.g., ?graph_sem.

Furthermore, the tidySEM package includes the following vignettes:

Structural Equation Modeling in General

Latent Class Analysis / Mixture Modeling

Citing tidySEM

Van Lissa CJ (????). tidySEM: Tidy Structural Equation Modeling. R package version 0.3.0, https://cjvanlissa.github.io/tidySEM/.

To cite the latent class analysis functionality in tidySEM, cite:

Van Lissa, C. J., Garnier-Villarreal, M., & Anadria, D. (2023). Recommended Practices in Latent Class Analysis using the Open-Source R-Package tidySEM. Structural Equation Modeling. https://doi.org/10.1080/10705511.2023.2250920

Contributing and Contact Information

If you have ideas, please get involved. You can contribute by opening an issue on ‘GitHub’, or sending a pull request with proposed features (see further instructions below).

  • File a ‘GitHub’ issue here
  • Make a pull request here

By participating in this project, you agree to abide by the Contributor Covenant.

Pull requests

  • Please always contribute via pull request instead of committing to master, so I can review the contribution.
    • You can either fork the repository to your own account and then submit a pull request, or make minor changes directly on this repository, and choose to commit them to a different branch and send a pull request when you save those changes
  • If you fix an issue, in your Commit message, please write “closes #issuenumber” so we can trace which commits fixed which issues
  • Please add a line to NEWS.md for each bug fix or feature contribution
  • Please increment the minor version number in DESCRIPTION, e.g.: 0.2.3.1 -> 0.2.3.2