Learn R Programming

piecewiseSEM (version 1.1.3)

endogenous.reverse: Updates basis set under certain conditions.

Description

A helper function for sem.missing.paths that reverses independence claims between intermediate endogenous variables fit to non-normal distributions.

Usage

endogenous.reverse(basis.set, modelList)

Arguments

basis.set
a list of tests of conditional independence claims obtained from sem.basis.set.
modelList
a list of regressions representing the structural equation model.

Value

Returns a list of conditional independence claims. The list contains duplicated entries, reversing the independence claims between endogenous variables that also predict other variables in the model *only if* those variables are fitted to a non-normal distribution.This is a temporary workaround for GLM(M)s that do not adhere to the property of symmetricity of independence claims as a function of transformations via the link function.

Examples

Run this code
## Not run: 
#   data = data.frame(
#     a = runif(50),
#     b = runif(50, 0, 1),
#     c = runif(50, 0, 1),
#     d = runif(50)
#   )
#   
#   modelList = list(
#     glm(b ~ a, family = "binomial", data),
#     glm(c ~ a, family = "binomial", data),
#     lm(d ~ b + c, data)
#   )
#   
#   (basis.set = sem.basis.set(modelList))
#   
#   endogenous.reverse(basis.set, modelList)
# ## End(Not run)

Run the code above in your browser using DataLab