reveal_outcomes: Reveal outcomes

Description Usage Arguments Details Value Examples

View source: R/reveal_outcomes.R

Description

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.

Usage

1
reveal_outcomes(model, dos = NULL, node = NULL)

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.

Details

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.

Value

A data.frame object of revealed data for each node (columns) given causal / nodal type (rows) .

Examples

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")

CausalQueries documentation built on July 1, 2020, 7:46 p.m.