Learn R Programming

piecewiseSEM (version 1.2.1)

get.sort.dag: Sorts adjacency matrix from parents to children

Description

A helper function for sem.basis.set that takes the adjacency matrix from get.dag and orders it based on the appearance of variables in the SEM. It first puts variables that have no links (i.e., exogenous variables), then those that have only links to exogenous variables, then links to both exogenous and those that have links (i.e., endogenous), and finally to only endogenous.

Usage

get.sort.dag(formulaList)

Arguments

formulaList

a list of model formula(e).

Value

Returns a matrix of 0s and 1s, 0 indicating no relationship and 1 indicating a relationship, with columns being predictors and rows being responses.