reveal_outcomes {CausalQueries} | R Documentation |
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.
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) .
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")