scc_to_dag {epicmodel}R Documentation

Transform SCC to DAG

Description

Creates an object of class dagitty (dagitty package) from a SCC model, following VanderWeele and Robins (2007).

Usage

scc_to_dag(scc, unknown = TRUE)

Arguments

scc

An object of class epicmodel_scc.

unknown

TRUE (default) or FALSE. If TRUE, unknown causes are added to the SCC model: every sufficient cause gets an additional individual unknown component cause representing additional unknown components; an unknown sufficient cause is added to the model consisting of a single unknown component cause and representing all unknown sufficient causes.

Value

A list of length 2 containing an object of class dagitty (named dag) and a data.frame containing the information, which label in the DAG corresponds to which component cause (named legend).

References

VanderWeele TJ, Robins JM (2007): Directed acyclic graphs, sufficient causes, and the properties of conditioning on a common effect. American Journal of Epidemiology 166 (9): 1096–1104.

See Also

Examples

# Create some SCC model
steplist_checked <- check_steplist(steplist_rain)
scc_model <- create_scc(steplist_checked)

# Transform it into a DAG
scc_to_dag(scc_model)

[Package epicmodel version 0.1.1 Index]