View source: R/translation-modules.R
create_effect_vector | R Documentation |
Translate target effect to vector of response variables
create_effect_vector(causal_model, effect)
causal_model |
An object of class "causalmodel" as produced by create_causalmodel |
effect |
Effect list, as returned by parse_effect |
A list with the target effect in terms of qs
graph <- initialize_graph(graph_from_literal(Z -+ X, X -+ Y, Ul -+ Z, Ur -+ X, Ur -+ Y))
constraints <- "X(Z = 1) >= X(Z = 0)"
effectt = "p{Y(X = 1) = 1} - p{Y(X = 0) = 1}"
p.vals <- expand.grid(Z = 0:1, X = 0:1, Y = 0:1)
prob.form <- list(out = c("X", "Y"), cond = "Z")
effect <- parse_effect(effectt)
ivmod <- create_causalmodel(graph, respvars = NULL, p.vals = p.vals, prob.form = prob.form,
constraints = constraints)
var.eff <- create_effect_vector(ivmod, effect)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.