Identifies exogenous variables (variables that have no paths leading to them) and removes them from the basis set when they appear as responses.
filter.exogenous(modelList, basis.set, corr.errors, add.vars)
a list
of regressions representing the structural equation model.
an list
of vectors representing conditional independence statements.
a vector of variables with correlated errors (separated by "~~").
a vector of additional variables whose independence claims should be evaluated, but which do not appear in the model list.
Returns a list
of independence claims. Each entry in the list
is a vector where the first entry is the predictor whose independence from the response is being evaluated, the second is the response, and remaining entries represent the variables on which the independence claim is conditional. E.g.,
[1] "x1" "y" "x2"
would be the missing path between y ~ x1
conditional on x2
. The basis set is constructed using the function basiSet
in the ggm
package.
Helper function for sem.basis.set
that removes independence claims between two exogenous (i.e., independent) variables, as the direction of causality cannot be reliably inferred from the SEM model list.
Shipley, Bill. "A new inferential test for path models based on directed acyclic graphs." Structural Equation Modeling 7.2 (2000): 206-218.