make_dag: Helper to run a causal statement specifying a DAG into a...

View source: R/make_models.R

make_dagR Documentation

Helper to run a causal statement specifying a DAG into a data.frame of pairwise parent child relations between nodes specified by a respective edge. This function reproduces the result of the following dagitty operations: dagitty::dagitty() |> dagitty::edges()

Description

Helper to run a causal statement specifying a DAG into a data.frame of pairwise parent child relations between nodes specified by a respective edge. This function reproduces the result of the following dagitty operations: dagitty::dagitty() |> dagitty::edges()

Usage

make_dag(statement)

Arguments

statement

character string. Statement describing causal relations using dagitty syntax. Only directed relations are permitted. For instance "X -> Y" or "X1 -> Y <- X2; X1 -> X2"

Value

a data.frame with columns v,w,e specifying parent, child and edge respectively


macartan/gbiqq documentation built on Oct. 17, 2024, 6:37 a.m.