Learn R Programming

imt (version 1.0.0)

createData: Converts a dataframe into a named list to provide data to a Stan model

Description

Converts a dataframe into a named list to provide data to a Stan model

Usage

createData(
  data,
  y,
  treatment,
  x = NULL,
  eta_mean = 0,
  eta_sd = 1,
  run_estimation = 1
)

Value

Returns
stan_data a named list providing the data for the stan model

Arguments

data

The data frame to be used

y

The name of the outcome variable in the data frame

treatment

The name of the treatment indicator variable in the data frame

x

A vector of names of all covariates to be used in the data frame

eta_mean

The prior mean to be used for estimating the treatment effect

eta_sd

The prior standard deviation to be used for estimating the treatment effect

run_estimation

Whether to run the estimation, or merely draw data from the priors