What's New

Structural equation modeling and confirmatory network analysis in one framework: estimate, test, and compare network models with the full statistical toolbox of SEM.

R> install.packages("psychonetrics")

What is psychonetrics?

psychonetrics is an R package that unifies structural equation modeling (SEM) and network analysis under a single framework. The core innovation is simple but powerful: any variance-covariance matrix in a model can be parameterized as a Gaussian Graphical Model (GGM), where edges represent partial correlations—i.e., conditional independence relationships between variables.

This means that standard psychometric models—confirmatory factor analysis, structural equation models, vector autoregressive models—can all be extended with network structures. A latent covariance matrix can become a latent network. Residual covariances can become a residual network. The package provides maximum likelihood estimation, model fit testing, and automated model search for all of these models.

More generally, any variance-covariance structure Σ in the model can be decomposed in one of five ways:

TypeDecompositionInterpretation
covΣ (direct)Covariance matrix
cholΣ = LLCholesky decomposition
precΣ = K−1Precision (inverse covariance) matrix
ggmΣ = Δ(IΩ)−1ΔGaussian Graphical Model (network)
corΣ = SD · P · SDCorrelation matrix

Furthermore, the package includes powerful exploratory search algorithms and offers novel modeling capabilities for longitudinal data (vector-autoregression), binary data (Ising model), and ill-defined latent variable models (Cholesky decomposition).

Key Features

Confirmatory Network Modeling

Specify, estimate, and test hypothesized network structures with full model fit statistics.

Multi-Group Analysis

Compare networks and SEM models across groups with flexible equality constraints and invariance testing.

Multiple Estimators

ML, FIML (missing data), robust ML (MLM / MLMV / MLMVS / MLR), PML/PFIML (penalized)*, WLS, DWLS, and WLSMV* estimation.

Automated Model Search

Pruning, stepwise search, and combined strategies guided by modification indices and information criteria.

Penalized Estimation*

LASSO, Ridge, and Elastic Net regularization with automatic penalty selection via EBIC.

Multiple Data Types

Continuous, ordinal*, and binary data. Cross-sectional, time-series, and panel data. Raw data or summary statistics.

Missing Data Handling

Full Information Maximum Likelihood (FIML) for handling missing data without listwise deletion.

High Performance

Core computations in C++ via Rcpp and RcppArmadillo for fast estimation, even with large models.

* Experimental feature — not yet fully validated.

Model Families

Varcov Family

Models a variance-covariance matrix directly. Use the GGM parameterization to estimate network models of observed variables, including multi-group comparisons.

Wrappers: ggm(), precision(), cholesky(), corr()

Learn more →

LVM Family

Latent variable models (CFA / SEM) where latent and residual covariances can be modeled as networks. Supports bifactor models and latent growth curves.

Wrappers: lnm(), rnm(), lrnm(), bifactor(), latentgrowth()

Learn more →

Ising & Blume-Capel Updated

Network models for binary and ordered categorical data from statistical physics. Now supports any number of ordered response options, plus the Blume-Capel model with per-node quadratic potentials.

Functions: Ising(), BlumeCapel()

Learn more →

Var1 Family

Lag-1 vector autoregressive models for time-series data. The contemporaneous covariance structure can be modeled as a GGM (graphical VAR). Extracts temporal (PDC) and contemporaneous (PCC) networks.

Wrappers: gvar()

Learn more →

DLVM1 & Panel Models RI-CLPM

Dynamic latent variable models for panel data. Decomposes temporal dynamics, within-person contemporaneous relations, and between-person individual differences into separate network structures. Now includes random-intercept cross-lagged panel models.

Wrappers: panelgvar(), panelvar(), ri_clpm(), panellvgvar()

Learn more →

Multi-level LVM

Two-level random-intercept latent variable models for clustered data (e.g., students in schools). Within-cluster and between-cluster structures can each be modeled as networks.

Wrappers: ml_lvm(), ml_lnm(), ml_rnm()

Learn more →

Meta-analysis Updated

Meta-analytic Gaussian network aggregation (MAGNA): pool correlation or covariance matrices across studies into a single network or SEM, with random-effects heterogeneity.

Wrappers: meta_ggm(), meta_varcov(), meta_lvm(), meta_gvar()

Learn more →

Methods & Estimation New

Robust & Scaled Estimation

Robust maximum-likelihood estimators for non-normal data — sandwich standard errors, scaled chi-square statistics, robust RMSEA/CFI/TLI, and scaled chi-square difference tests in compare(). Validated against lavaan.

Estimators: "MLM", "MLMV", "MLMVS", "MLR"

Learn more →

lavaan Interoperability

Move models between psychonetrics and lavaan: convert a fitted lavaan model (or syntax) into a psychonetrics lvm and back, reproducing estimates, standard errors, chi-square and log-likelihood exactly.

Functions: fromlavaan(), tolavaan()

Learn more →

Installation

# Install from CRAN:
install.packages("psychonetrics")

# Or install the development version from GitHub:
# install.packages("remotes")
remotes::install_github("SachaEpskamp/psychonetrics")

# Load the package:
library("psychonetrics")

Quick Start

The typical psychonetrics workflow follows a pipe-based pattern:

library("psychonetrics")
library("dplyr")

# 1. Specify a model (e.g., a Gaussian Graphical Model):
model <- ggm(data, vars = vars, omega = "full")

# 2. Estimate:
model <- model %>% runmodel

# 3. Inspect results:
model %>% fit          # Fit indices (chi-square, CFI, RMSEA, BIC, ...)
model %>% parameters   # Parameter estimates with SEs and p-values
model %>% MIs          # Modification indices

# 4. Modify and compare:
model_pruned <- model %>% prune(alpha = 0.01)   # Remove non-significant edges
model_final  <- model_pruned %>% stepup          # Add edges by modification index

compare(saturated = model, pruned = model_pruned, final = model_final)

See the General Tutorial for a comprehensive walkthrough.

Citations

If you use psychonetrics in your research, please cite the following papers:

Epskamp, S. (2020). Psychometric network models from time-series and panel data. Psychometrika, 85(1), 206–231. DOI: 10.1007/s11336-020-09697-3
Epskamp, S., Isvoranu, A. M., & Cheung, M. W.-L. (2022). Meta-analytic Gaussian network aggregation. Psychometrika, 87(1), 12–46. DOI: 10.1007/s11336-021-09764-3

BibTeX entries:

@article{epskamp2020psychometric,
  author = {Epskamp, Sacha},
  title = {Psychometric network models from time-series and panel data},
  journal = {Psychometrika},
  volume = {85},
  number = {1},
  pages = {206--231},
  year = {2020},
  doi = {10.1007/s11336-020-09697-3}
}

@article{epskamp2022meta,
  author = {Epskamp, Sacha and Isvoranu, Adela-Maria and Cheung, Mike W.-L.},
  title = {Meta-analytic {G}aussian network aggregation},
  journal = {Psychometrika},
  volume = {87},
  number = {1},
  pages = {12--46},
  year = {2022},
  doi = {10.1007/s11336-021-09764-3}
}