Symbolic Computation for Structural Equation Models

A collection of functions for symbolic computation using the 'caracas' package for structural equation models and other statistical analyses. Among its features is the ability to calculate the model-implied covariance (and correlation) matrix and the sampling covariance matrix of variable functions using the delta method.


R build status cran version Monthly Downloads Total Downloads Rdoc

symSEM

Symbolic Computation for Structural Equation Models

The symSEM package uses the caracas package, which depends on the SymPy library, for the symbolic computations.

The stable version can be installed from CRAN by:

install.packages("symSEM")

The developmental version can be installed from GitHub by:

## Install remotes package if it has not been installed yet
# install.packages("remotes")

remotes::install_github("mikewlcheung/symsem")

Example

Compute a symbolic model-implied covariance and correlation matrices

library(symSEM)

## A regression model
model <- "y ~ b1*x1 + b2*x2
          ## Covariance between x1 and x2
          x1 ~~ x2
          ## Means
          y ~ b0*1
          x1 ~ m1*1
          x2 ~ m2*1"

## Convert it into a RAM speculation
RAM <- metaSEM::lavaan2RAM(model)

## Implied covariance matrix and mean structure
impliedS(RAM, corr=FALSE)

## Implied correlation matrix
impliedS(RAM, corr=TRUE)

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("symSEM")

0.4 by Mike Cheung, 2 years ago


https://github.com/mikewlcheung/symsem


Browse source code at https://github.com/cran/symSEM


Authors: Mike Cheung [aut, cre]


Documentation:   PDF Manual  


GPL (>= 2) license


Imports OpenMx, metaSEM

Depends on caracas

Suggests testthat, roxygen2

System requirements: Python (>= 3.6.0)


See at CRAN