Learn R Programming

CausalQueries (version 1.1.0)

te: Make treatment effect statement (positive)

Description

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)

Value

A character statement of class statement

Arguments

X

A character. The quoted name of the input node

Y

A character. The quoted name of the outcome node

See Also

Other statements: complements(), decreasing(), increasing(), interacts(), non_decreasing(), non_increasing(), substitutes()

Examples

Run this code
# \donttest{
te('A', 'B')

model <- make_model('X->Y') %>% set_restrictions(increasing('X', 'Y'))
query_model(model, list(ate = te('X', 'Y')),  using = 'parameters')

# 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'))
}

Run the code above in your browser using DataLab