An Algorithm for the Hierarchical Organization of Path Diagrams and Calculation of Components of Expected Covariance

Modern structural equation modeling (SEM) software programs include user interfaces for the entry of graphical diagrams as a method for the production of the underlying matrixes that are then manipulated in traditional ways to provide parameter estimates and fit statistics. This work presents an algorithm for the solution of the problem in the reverse order: automatically producing a graphical diagram from a matrix formula in such a way that its components are logically and hierarchically arranged. In the process, the individual path components of expected covariance between variables are calculated and feedback loops or so-called nonrecursive paths are recognized and tagged. Possible uses for this algorithm include automatic recognition of regions of structural underidentification in a model and the didactic graphical display of the components of expected covariance between variables. This algorithm relies on the matrix equations of McArdle and McDonald (1984), a general purpose SEM formulation.