Learn R Programming

⚠️There's a newer version (0.2.10) 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 free open source R packages lavaan or OpenMx, or the commercial closed-source program Mplus (controlled through the R package MplusAutomation). The aim of tidySEM is to provide three specific functions:

  1. Generate model syntax in a top-down, tidy way,
    • With particular attention to specifying mixture models in OpenMx
  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: Tidy structural equation modeling. R package version 0.2.1. 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

7,966

Version

0.2.3

License

GPL (>= 3)

Maintainer

Caspar van Lissa

Last Published

April 14th, 2022

Functions in tidySEM (0.2.3)

add_paths

Add paths to an object of class 'tidy_sem'
as_lavaan

Convert tidy_sem to 'lavaan' syntax
class_prob

Obtain latent class probabilities
edit_graph

Edit graph elements
chisq_sb

Satorra-Bentler corrected chi-square test
empathy

Simulated empathy data
BCH

Estimate an Auxiliary Model using the BCH Method
if_edit

Conditionally edit a sem_graph object
lsub

Apply pattern replacement over a vector
measurement

Generate syntax for a measurement model
mixture_starts

Automatically set starting values for an OpenMx mixture model
run_lavaan

Run as lavaan model
BLRT

Conduct Bootstrapped Likelihood Ratio Test
get_fit

Get fit indices from objects
get_layout.lavaan

Generate graph layout
nodes

Extract nodes from sem_graph
mx_profiles

Estimate latent profile analyses using OpenMx
plot_density

Create density plots for mixture models
descriptives

Describe a dataset
data_mix_ordinal

Simulated data for mixture model with ordinal indicators
plot_prob

Plot categorical variable probabilities
dictionary

Extract dictionary from tidy_sem
cors

Generate syntax for correlations
conf_int

Format confidence intervals
table_fit

Print model fit table formatted for publication
table_cors

Extract correlation tables
run_mx

Run as OpenMx model with sensible defaults
paste2

Concatenate Strings while omitting NA
skew_kurtosis

Calculate skew and kurtosis
syntax

Extract syntax from tidy_sem
edges

Extract edges from sem_graph
plot_bivariate

Create correlation plots for a mixture model
estimate_mx

Estimate tidy_sem using 'OpenMx'
estimate_mplus

Estimate tidy_sem using 'Mplus'
mx_lca

Estimate latent class analyses using OpenMx
mx_mixture

Estimate mixture models using OpenMx
plot_profiles

Create latent profile plots
tidy_sem

Create a tidy_sem object
as_ram

Convert lavaan syntax to RAM specification
as_mplus

Convert tidy_sem to 'Mplus' syntax
est_sig

Add significance asterisks to object
estimate_lavaan

Estimate tidy_sem using 'lavaan'
get_data

Extract data from tidy_sem
poms

Apply POMS-coding to data
get_edges

Extract edges from a SEM model object
table_prob

Results table in probability scale
create_scales

Create scale scores from observed variables
table_results

Print results table formatted for publication
prepare_graph

Prepare graph data
graph_sem

Render a graph
get_nodes

Extract nodes from a SEM model object
mplus_expand_names

Expand abbreviated Mplus variable names
curry_mac

Simulated MAC data
report

Report formatted number
mx_growth_mixture

Estimate growth mixture models using OpenMx