prep_stan_data: Prepare data for 'stan'

View source: R/prep_stan_data.R

prep_stan_dataR Documentation

Prepare data for 'stan'

Description

Create a list containing the data to be passed to 'stan

Usage

prep_stan_data(
  model,
  data,
  keep_type_distribution = TRUE,
  censored_types = NULL
)

Arguments

model

A causal_model. A model object generated by make_model.

data

A data.frame. Data of nodes that can take three values: 0, 1, and NA. In long form as generated by make_events

Value

A list containing data to be passed to 'stan'

Examples


model <- make_model('X->Y')
data  <-  collapse_data(make_data(model, n = 6), model)
CausalQueries:::prep_stan_data(model, data)

model <- make_model('X->Y') |>
  set_confound(list(X = 'Y[X=1]>Y[X=0]'))
data  <-  collapse_data(make_data(model, n = 6), model)
CausalQueries:::prep_stan_data(model, data)



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