Learn R Programming

⚠️There's a newer version (0.2.8) of this package.Take me there.

tidySEM

The package tidySEM provides a ‘tidy’ workflow for conducting, reporting, and plotting structural equation modeling analyses. It does not perform model estimation, but instead allows users to estimate models in a software-agnostic way, using either the R package lavaan, or the commercial stand-alone program Mplus (through MplusAutomation). The aim of tidySEM is to provide three specific functions:

  1. Generate model syntax in a top-down, tidy way,
  2. Tabulate model output in a publication-ready, uniform manner,
  3. Make easily customizable graphs for SEM-models.

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 development version of tidySEM from ‘GitHub’ with:

install.packages("devtools")
devtools::install_github("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, there are three main vignettes, describing the three main tracks of tidySEM functions:

  1. A vignette about generating syntax and estimating models
  2. A vignette about tabulating results
  3. A vignette about making graphs

Citing tidySEM

You can cite the R-package with the following citation:

Van Lissa, C. J., (2019). tidySEM: A tidy workflow for running, reporting, and plotting structural equation models in lavaan or Mplus. R package version 0.1.6. https://github.com/cjvanlissa/tidySEM/

Contributing and Contact Information

If you have ideas, please get involved. I am currently looking for a major contributor on this project, and smaller contributions are also welcome. You can contribute by opening an issue on ‘GitHub’, or sending a pull request with proposed features.

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

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

Copy Link

Version

Install

install.packages('tidySEM')

Monthly Downloads

3,164

Version

0.1.9

License

GPL (>= 3)

Maintainer

Caspar van Lissa

Last Published

April 20th, 2021

Functions in tidySEM (0.1.9)

cors

Generate syntax for correlations
edges

Extract edges from sem_graph
prepare_graph

Prepare graph data
get_nodes

Extract nodes from a SEM model object
get_layout.lavaan

Generate graph layout
report

Report formatted number
graph_sem

Render a graph
estimate_lavaan

Estimate tidy_sem using 'lavaan'
edit_graph

Edit graph elements
estimate_mplus

Estimate tidy_sem using 'Mplus'
measurement

Generate syntax for a measurement model
tidy_sem

Create a tidy_sem object
mplus_expand_names

Expand abbreviated Mplus variable names
table_cors

Extract correlation tables
table_results

Print results table formatted for publication
get_data

Extract data from tidy_sem
get_edges

Extract edges from a SEM model object
est_sig

Add significance asterisks to object
if_edit

Conditionally edit a sem_graph object
skew_kurtosis

Calculate skew and kurtosis
syntax

Extract syntax from tidy_sem
nodes

Extract nodes from sem_graph
poms

Apply POMS-coding to data
dictionary

Extract dictionary from tidy_sem
as_mplus

Convert tidy_sem to 'Mplus' syntax
chisq_sb

Satorra-Bentler corrected chi-square test
create_scales

Create scale scores from observed variables
descriptives

Describe a dataset
add_paths

Add paths to an object of class 'tidy_sem'
as_lavaan

Convert tidy_sem to 'lavaan' syntax
conf_int

Format confidence intervals