Realise 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.
realise_outcomes(model, dos =NULL, node =NULL, add_rownames =TRUE)
Arguments
model: A causal_model. A model object generated by make_model.
dos: A named list. Do actions defining node values, e.g., list(X = 0, M = 1).
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 dos.
add_rownames: logical indicating whether to add causal types as rownames to the output
Returns
A data.frame object of revealed data for each node (columns) given causal / nodal type (rows).
Details
If a node is not specified all outcomes are realised for all possible causal types consistent with the model. If a node is specified then outcomes of Y are returned conditional on different values of parents, whether or not these values of the parents obtain given restrictions under the model.
realise_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.