as.lavaan.formula: Turn a causality graph into a lavaan formula

Description Usage Arguments Details Value Examples

View source: R/lavaan.R

Description

Use this function to convert a causality.graph into a lavaan formula so you can fit the model to the data and assess the quality of the model from the graph.

Usage

1

Arguments

cgraph

A causality.graph to be turned into a lavaan formula

Details

currently, only DAGs are supported, though patterns and PDAGs with DAG extensions are accepted. Future work will inlcude PAGs, and including output from the FnFC family as a latent measurement model.

Value

a lavaan formula, or an error

Examples

1
2
3
4
# turn the dag from Sachs(2009) DAG into a lavaan compatable formula
library(lavaan)
lavaan.forumula <- as.lavaan.formula(sachs.dag)
fit <- cfa(lavaan.formula, data = sachs.df)

tzimiskes/causality documentation built on Sept. 15, 2019, 8:41 p.m.