A: Subsetting/Indexing Actions Defined for 'DAG' Object

Description Usage Arguments Value Examples

View source: R/action_node_indexing.R

Description

Subsetting/Indexing Actions Defined for DAG Object

Usage

1
A(DAG)

Arguments

DAG

A DAG object that was defined using functions node, set.DAG and action.

Value

returns a list of actions, which are intervened versions of the original observed data DAG.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
D <- DAG.empty()
D <- D + node(name="W1", distr="rbern", prob=plogis(-0.5))
D <- D + node(name="W2", distr="rbern", prob=plogis(-0.5 + 0.5*W1))
D <- D + node(name="A", distr="rbern", prob=plogis(-0.5 + 0.5*W1+ 0.5*W2))
D <- set.DAG(D)
# Define two actions, acting on node "A"
D <- D + action("A0", nodes=node("A", distr="rbern", prob=0))
D <- D + action("A1", nodes=node("A", distr="rbern", prob=1))
# Select both actions
A(D)
# Select action "A1" only
A(D)["A1"]

osofr/simcausal documentation built on Jan. 6, 2019, 3:05 a.m.