Recursive Partitioning for Structural Equation Models

SEM Trees and SEM Forests -- an extension of model-based decision trees and forests to Structural Equation Models (SEM). SEM trees hierarchically split empirical data into homogeneous groups sharing similar data patterns with respect to a SEM by recursively selecting optimal predictors of these differences. SEM forests are an extension of SEM trees. They are ensembles of SEM trees each built on a random sample of the original data. By aggregating over a forest, we obtain measures of variable importance that are more robust than measures from single trees.

DOI cranversion rstudio mirrordownloads

What is this?

An R package for estimating Structural Equation Model Trees and Forests.


To install the latest semtree package directly from GitHub, copy the following line into R:



Please see official semtree website:


Theory and method:

Brandmaier, A. M., Driver, C., & Voelkle, M. C. (in press). Recursive partitioning in continuous time analysis. In K. van Montfort, J. Oud, & M. C. Voelkle (Eds.), Continuous time modeling in the behavioral and related sciences. New York: Springer.

Brandmaier, A. M., Prindle, J. J., McArdle, J. J., & Lindenberger, U. (2016). Theory-guided exploration with structural equation model forests. Psychological Methods, 21, 566-582.

Brandmaier, A. M., von Oertzen, T., McArdle, J. J., & Lindenberger, U. (2014). Exploratory data mining with structural equation model trees. In J. J. McArdle & G. Ritschard (Eds.), Contemporary issues in exploratory data mining in the behavioral sciences (pp. 96-127). New York: Routledge.

Brandmaier, A. M., von Oertzen, T., McArdle, J. J., & Lindenberger, U. (2013). Structural equation model trees. Psychological Methods, 18, 71-86.

Applied examples:

Brandmaier, A. M., Ram, N., Wagner, G. G., & Gerstorf, D. (in press). Terminal decline in well-being: The role of multi-indicator constellations of physical health and psychosocial correlates. Developmental Psychology.


semtree 0.9.13

  • bugfix in invariance testing
  • fix to remove warning from rpart plot (version 3.0.0 and above)

semtree 0.9.12

  • bugfix in split evaluation procedure for cases where variables are named 'c', which crashed semtree
  • bugfix in varimpConvergencePlot: na.omit command logic was inverted

semtree 0.9.11

  • semforests support for lavaan models including variable importance and partial dependence
  • crossvalidated likelihood supported with lavaan
  • plots of semtrees show correct #df when using focus parameters
  • added diversity functions

semtree 0.9.10

  • added file
  • bugfix to partial dependence on variables of type factor
  • bugfixes to plotting of partial dependence
  • deprecated partialDependencePlot and introduced partialDependence() function with S3 plotting method
  • added parallel computation option to partialDependence
  • added new demo scripts
  • added extra.legend paramter to varimpConvergencePlot
  • bugfix in traverse() that led to underestimations of variable importance in some cases
  • added error message when trying to use lavaan and global constraints

Reference manual

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


0.9.14 by Andreas M. Brandmaier, a year ago

Browse source code at

Authors: Andreas M. Brandmaier [aut, cre] , John J. Prindle [aut] , Manuel Arnold [aut]

Documentation:   PDF Manual  

Task views: Psychometric Models and Methods

GPL-3 license

Imports bitops, sets, digest, rpart, rpart.plot, parallel, plotrix, cluster, stringr, matrixcalc, expm, ggplot2, tidyr, matrixStats, methods, MASS, mvtnorm

Depends on OpenMx

Suggests lavaan, knitr, rmarkdown

See at CRAN