Learn R Programming

CausalQueries (version 0.0.3)

get_nodal_types: Get list of types for nodes in a DAG

Description

As type labels are hard to interpret for large models, the type list includes an attribute to help interpret them. See attr(types, interpret)

Usage

get_nodal_types(model, collapse = TRUE)

Arguments

model

A causal_model. A model object generated by make_model.

collapse

Logical. If `TRUE`, shows unique nodal types for each node. If `FALSE`, shows for each node a matrix with nodal types as rows and parent types as columns, if applicable. Defaults to `TRUE`.

Value

A named list of nodal types for each parent in a DAG

Examples

Run this code
# NOT RUN {
model <- make_model('X -> K -> Y')
get_nodal_types(model)

model <- make_model('X -> K -> Y') %>%
   set_restrictions(statement = 'K[X=1]>K[X=0]') %>%
   set_confound(list(K = 'Y[K=1]>Y[K=0]'))
get_nodal_types(model)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab