prepost_gibbs {prepost} | R Documentation |
Run Gibbs sampler for the random moderator placement design
Description
Run Gibbs sampler for the random moderator placement design
Usage
prepost_gibbs(
formula,
data,
prepost,
moderator,
covariates,
iter = 1000,
thin = 1,
burn = 0,
offset = 0,
monotonicity = TRUE,
stable = TRUE,
saturated = TRUE,
priors
)
Arguments
formula |
A formula with syntax |
data |
A data.frame containing variables in the formula, moderator, and covariates arguments. |
prepost |
A one-sided formula with syntax |
moderator |
A one-sided formuala with syntax |
covariates |
A one-sided formula with syntax |
iter |
Integer indicating the number of iterations for the Gibbs sampler. |
thin |
Integer indicating how often the Gibbs sampler should save a draw. |
burn |
Integer indicating how many iterations should be performed before saving draws in the Gibbs sampler. |
offset |
A numeric value indicating the center of the prior distribution for the covariate coefficients. |
monotonicity |
A logical signifying whether the model assumes monotonicity. |
stable |
A logical signifying whether the model assumes that the the pre vs post indicator does not affect the moderator under the control condition for treatment. |
saturated |
A logical indicating whether the coefficients on the covariates are allowed to vary by the principal strata. |
priors |
A list object containing the priors for the Gibbs sampler. Priors include beta.precision, psi.precision, alpha, y.alpha, and y.beta. |
Value
A list object containing Gibbs posterior quantities of interest and parameters.
Examples
data(land_experiment)
prepost_gibbs(
support ~ treat_comb,
data = land_experiment,
moderator = ~ land_insecure,
prepost = ~ prepost,
covariates = ~ educ + age,
iter = 50
)