Skip to contents

Generate a statement for (Y(1) - Y(0)). This statement when applied to a model returns an element in (1,0,-1) and not a set of cases. This is useful for some purposes such as querying a model, but not for uses that require a list of types, such as set_restrictions.

Usage

te(X, Y)

Arguments

X

A character. The quoted name of the input node

Y

A character. The quoted name of the outcome node

Value

A character statement of class statement

See also

Examples

# \donttest{
te('A', 'B')
#> 
#> Statement: 
#> (B[A=1] - B[A=0])

model <- make_model('X->Y') %>% set_restrictions(increasing('X', 'Y'))
query_model(model, list(ate = te('X', 'Y')),  using = 'parameters')
#> 
#> Causal queries generated by query_model (all at population level)
#> 
#> |query |using      |   mean|
#> |:-----|:----------|------:|
#> |ate   |parameters | -0.333|
#> 

# set_restrictions  breaks with te because it requires a listing
# of causal types, not numeric output.
# }
if (FALSE) {
model <- make_model('X->Y') %>% set_restrictions(te('X', 'Y'))
}