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)
Arguments
model: A causal_model. A model object generated by make_model.
condition: A vector of characters. Strings specifying the child node, followed by '|' (given) and the values of its parent nodes in model.
position: A named list of integers. The name is the name of the child node in model, and its value a vector of digit positions in that node's nodal type to be interpreted. See Details.
nodes: A vector of names of nodes. Can be used to limit interpretation to selected nodes.
Returns
A named list with interpretation of positions of the digits in a nodal type
Details
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.
Examples
model <- make_model('R -> X; Z -> X; X -> Y')#Return interpretation of all digit positions of all nodesinterpret_type(model)#Example using digit positioninterpret_type(model, position = list(X = c(3,4), Y =1))interpret_type(model, position = list(R =1))#Example using conditioninterpret_type(model, condition = c('X | Z=0 & R=1','X | Z=0 & R=0'))# Example using node namesinterpret_type(model, nodes = c("Y","R"))