Ecologists and evolutionary biologists rely on an increasingly sophisticated set of statistical tools to describe complex natural systems. One such tool that has gained significant traction in the biological sciences is structural equation models (SEM), a form of path analysis that resolves complex multivariate relationships among a suite of interrelated variables.
Evaluation of SEMs has historically relied on covariances among variables, rather than the values of the data points themselves. While this approach permits a wide variety of model forms, it limits the incorporation of detailed specifications. Recent developments have allowed for the simultaneous implementation of non‐normal distributions, random effects and different correlation structures using local estimation, but this process is not yet automated and consequently, evaluation can be prohibitive with complex models.
Here, I present a fully documented, open‐source package
piecewiseSEM, a practical implementation of confirmatory path analysis for the
r programming language. The package extends this method to all current (generalized) linear, (phylogenetic) least‐square, and mixed effects models, relying on familiar
r syntax. I also provide two worked examples: one involving random effects and temporal autocorrelation, and a second involving phylogenetically independent contrasts.
My goal is to provide a user‐friendly and tractable implementation of SEM that also reflects the ecological and methodological processes generating data.