analyze_graph {causaloptim} | R Documentation |
The graph must contain edge attributes named "leftside" and "lrconnect" that takes values 0 and 1. Only one edge may have a value 1 for lrconnect. The shiny app returns a graph in this format.
analyze_graph(graph, constraints, effectt)
graph |
An aaa-igraph-package object that represents a directed acyclic graph |
constraints |
A vector of character strings that represent the constraints |
effectt |
A character string that represents the causal effect of interest |
A an object of class "linearcausalproblem", which is a list with the following components. This list can be passed to optimize_effect which interfaces with Balke's code. Print and plot methods are also available.
Character vector of variable names of potential outcomes, these start with 'q' to match Balke's notation
Character vector of parameter names of observed probabilities, these start with 'p' to match Balke's notation
Character vector of parsed constraints
Character string defining the objective to be optimized in terms of the variables
Matrix of all possible values of the observed data vector, corresponding to the list of parameters.
Matrix of all possible values of the response function form of the potential outcomes, corresponding to the list of variables.
A nested list containing information on the parsed causal query.
The objective in terms of the original variables, before algebraic variable reduction. The nonreduced variables can be obtained by concatenating the columns of q.vals.
List of response functions.
The graph as passed to the function.
A matrix with coefficients relating the p.vals to the q.vals p = R * q
A vector of coefficients relating the q.vals to the objective function theta = c0 * q
A matrix with coefficients to represent the inequality constraints
### confounded exposure and outcome b <- igraph::graph_from_literal(X -+ Y, Ur -+ X, Ur -+ Y) V(b)$leftside <- c(0,0,0) V(b)$latent <- c(0,0,1) E(b)$rlconnect <- E(b)$edge.monotone <- c(0, 0, 0) analyze_graph(b, constraints = NULL, effectt = "p{Y(X = 1) = 1} - p{Y(X = 0) = 1}")