Learn R Programming

causaleffect (version 1.3.15)

transport: Derive a transport formula for a causal effect between two domains

Description

This function returns an expression for the transport formula of a causal effect between two domains. The formula is returned for the interventional distribution of the set of variables (y) given the intervention on the set of variables (x) in a selection diagram (D). If the effect is non-transportable, an error is thrown describing the graphical structure that witnesses non-transportability. The vertices of (D) that correspond to selection variables must have a description parameter of a single character "S" (shorthand for "selection"). By default, every variable is available for intervention in the source. If only a subset of the variables is available, then the set (z) can be used to derive specific z-transportability.

Usage

transport(y, x, z = NULL, D, expr = TRUE, simp = TRUE, 
  steps = FALSE, primes = FALSE, stop_on_nonid = TRUE)

Value

If steps = FALSE, A character string or an object of class probability that describes the transport formula. Otherwise, a list as described in the arguments.

Arguments

y

A character vector of variables of interest given the intervention.

x

A character vector of the variables that are acted upon.

z

A character vector of variables available for intervention. NULL value corresponds to ordinary transportability.

D

An igraph object describing a selection diagram in the internal syntax.

expr

A logical value. If TRUE, a string is returned describing the expression in LaTeX syntax. Else, a list structure is returned which can be manually parsed by the function get.expression

simp

A logical value. If TRUE, a simplification procedure is applied to the resulting probability object. d-separation and the rules of do-calculus are applied repeatedly to simplify the expression.

steps

A logical value. If TRUE, returns a list where the first element corresponds to the expression of the causal effect and the second to the a list describing intermediary steps taken by the algorithm.

primes

A logical value. If TRUE, prime symbols are appended to summation variables to make them distinct from their other instantiations.

stop_on_nonid

A logical value. If TRUE, an error is produced when a non-identifiable effect is discovered. Otherwise recursion continues normally.

Author

Santtu Tikka

References

Bareinboim E., Pearl J. 2013a A General Algorithm for Deciding Transportability of Experimental Results. Journal of Causal Inference, 1, 107--134.

Bareinboim E., Pearl J. 2013c Causal Transportability with Limited Experiments. Proceedings of the 27th AAAI Conference on Artificial Intelligence, 95--101.

See Also

parse.graphml, get.expression, generalize, meta.transport

Examples

Run this code
library(igraph)

# We set simplify = FALSE to allow multiple edges.
d <- graph.formula(X -+ Z, Z -+ W, W -+ V, V -+ Y, S -+ V, # Observed edges
  X -+ Z, Z -+ X, V -+ Y, Y -+ V, X -+ Y, Y -+ X, simplify = FALSE)

# Here the bidirected edges are set to be unobserved in the selection diagram d.
# This is denoted by giving them a description attribute with the value "U".
# The first five edges are observed, the rest are unobserved.
d <- set.edge.attribute(d, "description", 6:11, "U")

# The variable "S" is a selection variable. This is denoted by giving it
# a description attribute with the value "S". 
d <- set.vertex.attribute(d, "description", 6, "S")

transport(y = "Y", x = "X", D = d)

Run the code above in your browser using DataLab