Description Usage Arguments Details Value Examples
View source: R/reveal_outcomes.R
Reveal outcomes for all causal types. Calculated by sequentially calculating endogenous nodes. If a do operator is applied to any node then it takes the given value and all its descendants are generated accordingly.
1 | reveal_outcomes(model, dos = NULL, node = NULL)
|
model |
A |
dos |
A named |
node |
A character. An optional quoted name of the node whose outcome should be revealed. If specified all values of parents need to be specified via |
reveal_outcomes
starts off by creating types (via get_nodal_types
). It then takes types of endogenous and reveals their outcome based on the value that their parents took. Exogenous nodes outcomes correspond to their type.
A data.frame
object of revealed data for each node (columns) given causal / nodal type (rows) .
1 2 3 4 5 6 7 8 | model <- make_model("X -> Y")
reveal_outcomes(model)
model <- make_model("X1->Y;X2->M;M->Y")
reveal_outcomes(model, dos = list(X1 = 1, M = 0))
model <- make_model("X->M->Y")
reveal_outcomes(model, dos = list(M = 1), node = "Y")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.