View source: R/translation-modules.R
create_q_matrix | R Documentation |
Translate response functions into matrix of counterfactuals
create_q_matrix(respvars, right.vars, cond.vars, constraints)
respvars |
A list of functions as returned by create_response_function |
right.vars |
Vertices of graph on the right side |
cond.vars |
Vertices of graph on the left side |
constraints |
A vector of character strings that represent the constraints |
A list of 3 data frames of counterfactuals and their associated labels
graphres <- initialize_graph(graph_from_literal(Z -+ X, X -+ Y, Ul -+ Z, Ur -+ X, Ur -+ Y))
constraints <- "X(Z = 1) >= X(Z = 0)"
cond.vars <- V(graphres)[V(graphres)$leftside == 1 & names(V(graphres)) != "Ul"]
right.vars <- V(graphres)[V(graphres)$leftside == 0 & names(V(graphres)) != "Ur"]
respvars <- create_response_function(graphres)
create_q_matrix(respvars, right.vars, cond.vars, constraints)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.