Latent Variable Network Modeling

Estimate, fit and compare Structural Equation Models (SEM) and network models (Gaussian Graphical Models; GGM) using OpenMx. Allows for two possible generalizations to include GGMs in SEM: GGMs can be used between latent variables (latent network modeling; LNM) or between residuals (residual network modeling; RNM). For details, see Epskamp, Rhemtulla and Borsboom (2017) .

This package can be used to confirmatory test latent variable network models. See ?lvnet for details. To install the package, use:


Requires OpenMx to be installed.

# Load package:
# Load dataset:
Data <- HolzingerSwineford1939[,7:15]
# Measurement model:
Lambda <- matrix(0, 9, 3)
Lambda[1:3,1] <- NA
Lambda[4:6,2] <- NA
Lambda[7:9,3] <- NA
# Fit CFA model:
CFA <- lvnet(Data, lambda = Lambda)
# Latent network:
Omega_psi <- matrix(c(
# Fit model:
LNM <- lvnet(Data, lambda = Lambda, omega_psi=Omega_psi)
# Compare fit:


Changes in Version 0.3.3 o Added 'refitAll' argument to lvnetLasso to refit all models in the LASSO path before evaluating EBIC. This leads to similar functionality as qgraph::ggmModSelect(.., stepwise = FALSE), although the performance is slower. o The argument 'refit' has been renamed 'refitFinal' o Removed a warning on depracated dplyr functions o Fixed a bug in counting the number of parameters in RNM LASSO estimation

Changes in Version 0.3.3 o 'ggmFit' is no longer exported by lvnet

Changes in Version 0.3.2 o Summary output now contains parameter labels o Equality constraints now supported by supplying labels in model matrices

Changes in Version 0.3.1: o 'ggmFit' is now moved to qgraph and exported by lvnet o Several updates to ggmFit in qgraph o Added 'lvnetRefit' to refit an lvnet model to new data

Changes in Version 0.3: o 'scale' now defaults to FALSE! o Due to this change, some values such as the BIC will be different o Fixed a bug where higher order latent variables were not usuable o Added the 'mimic' argument. mimic = "lavaan" will mimic lavaan results (now default). o lvnet should now return the same fit as lavaan when is used in lavaan. o Added the function 'lav2lvnet' to easily generate lvnet input from a lavaan model o Added 'ggmFit' to fit a given partial correlation network (Gaussian graphical model; GGM)

Reference manual

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


0.3.5 by Sacha Epskamp, a year ago

Browse source code at

Authors: Sacha Epskamp

Documentation:   PDF Manual  

Task views: gRaphical Models in R, Psychometric Models and Methods

GPL-2 license

Imports glasso, qgraph, Matrix, psych, mvtnorm, parallel, corpcor, dplyr, methods, lavaan, semPlot

Depends on OpenMx

See at CRAN