causaloptim1.0.0 package

An Interface to Specify Causal Graphs and Compute Bounds on Causal Effects

analyze_graph

Analyze the causal graph and effect to determine constraints and objec...

btm_var

Recursive function to get the last name in a list

causaloptim-package

An Interface to Specify Causal Graphs and Compute Bounds on Causal Eff...

causalproblemcheck

Check conditions on causal problem

check_constraints_violated

Check whether any of the observable constraints implied by the causal ...

querycheck

Check conditions on query

rdirichlet

Sample from a Dirichlet distribution

sample_distribution

Sample a distribution of observable probabilities that satisfy the cau...

simulate_bounds

Simulate bounds

check_linear_objective

Check linearity of objective function implied by a causal model and ef...

check_parents

Check for paths from from to to

constraintscheck

Check constraints

create_causalmodel

Create a structural causal model from a graph or a set of response fun...

create_effect_vector

Translate target effect to vector of response variables

create_linearcausalproblem

Create linear causal problem from causal model and effect

create_q_matrix

Translate response functions into matrix of counterfactuals

create_response_function

Translate regular DAG to response functions

find_all_paths

Find all paths in a causal model

get_default_effect

Define default effect for a given graph

graphrescheck

Check conditions on digraph

initialize_graph

Initialize an igraph object for use with causaloptim

interpret_bounds

Convert bounds string to a function

latex_bounds

Latex bounds equations

list_to_path

Recursive function to translate an effect list to a path sequence

opt_effect

Compute a bound on the average causal effect

optimize_effect_2

Run the optimizer to obtain symbolic bounds

parse_constraints

Parse text that defines a the constraints

parse_effect

Parse text that defines a causal effect

plot_graphres

Plot the analyzed graph object

plot.linearcausalproblem

Plot the graph from the causal problem with a legend describing attrib...

print.causalmodel

Print relevant information about the causal model

print.linearcausalproblem

Print the causal problem

specify_graph

Shiny interface to specify network structure and compute bounds

update_effect

Update the effect in a linearcausalproblem object

When causal quantities are not identifiable from the observed data, it still may be possible to bound these quantities using the observed data. We outline a class of problems for which the derivation of tight bounds is always a linear programming problem and can therefore, at least theoretically, be solved using a symbolic linear optimizer. We extend and generalize the approach of Balke and Pearl (1994) <doi:10.1016/B978-1-55860-332-5.50011-0> and we provide a user friendly graphical interface for setting up such problems via directed acyclic graphs (DAG), which only allow for problems within this class to be depicted. The user can then define linear constraints to further refine their assumptions to meet their specific problem, and then specify a causal query using a text interface. The program converts this user defined DAG, query, and constraints, and returns tight bounds. The bounds can be converted to R functions to evaluate them for specific datasets, and to latex code for publication. The methods and proofs of tightness and validity of the bounds are described in a paper by Sachs, Jonzon, Gabriel, and Sjölander (2022) <doi:10.1080/10618600.2022.2071905>.

  • Maintainer: Michael C Sachs
  • License: MIT + file LICENSE
  • Last published: 2024-10-17