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

View source: R/action_node_indexing.R

AR Documentation

Subsetting/Indexing Actions Defined for DAG Object

Description

Subsetting/Indexing Actions Defined for DAG Object

Usage

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


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 Oct. 21, 2022, 3:09 a.m.