Learn R Programming

piecewiseSEM (version 1.2.1)

filter.exogenous: Filter exogenous variables from the basis set for SEM

Description

Identifies exogenous variables (variables that have no paths leading to them) and removes them from the basis set when they appear as responses.

Usage

filter.exogenous(modelList, basis.set, corr.errors, add.vars)

Arguments

modelList

a list of regressions representing the structural equation model.

basis.set

an list of vectors representing conditional independence statements.

corr.errors

a vector of variables with correlated errors (separated by "~~").

add.vars

a vector of additional variables whose independence claims should be evaluated, but which do not appear in the model list.

Value

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.

Details

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.

References

Shipley, Bill. "A new inferential test for path models based on directed acyclic graphs." Structural Equation Modeling 7.2 (2000): 206-218.