draw_causal_type: Draw a single causal type given a parameter vector

View source: R/draw_causal_type.R

draw_causal_typeR Documentation

Draw a single causal type given a parameter vector

Description

Output is a parameter dataframe recording both parameters (case level priors) and the case level causal type.

Usage

draw_causal_type(model, ...)

Arguments

model

A causal_model. A model object generated by make_model.

...

Arguments passed to 'set_parameters'

Examples


# Simple draw using model's parameter vector
make_model("X -> M -> Y") %>%
draw_causal_type(.)

# Draw parameters from priors and draw type from parameters
make_model("X -> M -> Y") %>%
draw_causal_type(., param_type = "prior_draw")

# Draw type given specified parameters
make_model("X -> M -> Y") %>%
draw_causal_type(., parameters = 1:10)

# Define a causal type and reveal data
model <- make_model("X -> Y; X <-> Y")
type <- model %>% draw_causal_type()
make_data(model, parameters = type$causal_type)

CausalQueries documentation built on June 22, 2024, 6:50 p.m.