Learn R Programming

prepost (version 0.3.0)

prepost_gibbs_nocovar: Run Gibbs sampler without covariates

Description

Run Gibbs sampler without covariates

Usage

prepost_gibbs_nocovar(
  formula,
  data,
  prepost,
  moderator,
  iter = 1000,
  thin = 1,
  burn = 0,
  monotonicity = TRUE,
  stable = TRUE,
  priors,
  predictive = FALSE
)

Value

A list object containing Gibbs posterior quantities of interest and parameters.

Arguments

formula

A formula with syntax y ~ t, where y is the name of the outcome variable and t is the name of the treatment.

data

A data frame containin the variables in the formula.

prepost

A one-sided formula with syntax ~ z, where z is the indicator variable for whether the moderator was measured pre- or post-treatment.

moderator

A formuala with syntax ~ d, where d is the moderator variable for the CATE.

iter

Numeric, number of iterations for the Gibbs

thin

Numeric, thinning parameter for the Gibbs

burn

Numeric, burn in rate for the Gibbs

monotonicity

A logical signifying whether Gibbs assumes monotonicity.

stable

A logical signifying whether Gibbs assumes stability.

priors

A list object containing the priors for the Gibbs sampler. Priors include beta.precision, psi.precision, alpha, y.alpha, and y.beta.

predictive

A logical indicator for whether to return prior predictive draws (TRUE) or posterior draws (FALSE, default).

Examples

Run this code
data(land_experiment)
prepost_gibbs_nocovar(
  support ~ treat_comb,
  data = land_experiment,
  moderator = ~ land_insecure,
  prepost = ~ prepost,
  iter = 50
)

Run the code above in your browser using DataLab