scc_to_dag | R Documentation |
Creates an object of class dagitty
(dagitty
package) from a SCC model, following VanderWeele and Robins (2007).
scc_to_dag(scc, unknown = TRUE)
scc |
An object of class |
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. |
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
).
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.
dagitty::dagitty()
SCC models
for more information on unknown causes and SCC models in general
plot_dag()
to create a ggplot
object from dagitty
model code
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.