get_nodal_types: Get list of types for nodes in a DAG

View source: R/get_nodal_types.R

get_nodal_typesR Documentation

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


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)



CausalQueries documentation built on Oct. 20, 2023, 1:06 a.m.