interpret_type | R Documentation |
Interprets the position of one or more digits (specified by position
)
in a nodal type. Alternatively returns nodal type digit positions that
correspond to one or more given condition
.
interpret_type(model, condition = NULL, position = NULL, nodes = NULL)
model |
A |
condition |
A vector of characters. Strings specifying the child node,
followed by '|' (given) and the values of its parent nodes in |
position |
A named list of integers. The name is the name of the child
node in |
nodes |
A vector of names of nodes. Can be used to limit interpretation to selected nodes. |
A node for a child node X with k
parents has a nodal type
represented by X followed by 2^k
digits. Argument position
allows user to interpret the meaning of one or more digit positions in any
nodal type. For example position = list(X = 1:3)
will return the
interpretation of the first three digits in causal types for X.
Argument condition
allows users to query the digit position in the
nodal type by providing instead the values of the parent nodes of a given
child. For example, condition = 'X | Z=0 & R=1'
returns the digit
position that corresponds to values X takes when Z = 0 and R = 1.
A named list
with interpretation of positions of
the digits in a nodal type
model <- make_model('R -> X; Z -> X; X -> Y')
#Return interpretation of all digit positions of all nodes
interpret_type(model)
#Example using digit position
interpret_type(model, position = list(X = c(3,4), Y = 1))
interpret_type(model, position = list(R = 1))
#Example using condition
interpret_type(model, condition = c('X | Z=0 & R=1', 'X | Z=0 & R=0'))
# Example using node names
interpret_type(model, nodes = c("Y", "R"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.