bayesTrtEffects: Bayesian Estimation of Treatment Effects in Panel Setting

Description Usage Arguments Value

View source: R/bayesTrtEffects.R


bayesTrtEffects performs an estimation of treatment effects on panel structured data. The dataset may be unbalanced, but needs to fullfill certain conditions to be properly useable. The function offers some model choices, which provide the framework in which the treatment effect is to be estimated.


bayesTrtEffects(base_mat, panel_mat, type = "SF", covars = NULL,
  mcmc_control = list(burnin = 1000, select = 500, M = 1000),
  prior_control = list(var_sel = 5, var_fix = 0.1),
  control = list(fix_alpha = FALSE, fix_beta = FALSE, fix_sigma = FALSE,
  fix_f = FALSE, sort_data = TRUE, test = FALSE), model_name = "model1",
  data_name = "treatment dataset 1")



a data frame or matrix file, containing id, maximum panel time on each subject, the treatment indicator and the baseline features.


a data frame of matrix file, containing id, panel times per subject, the panel outcomes and other features, relevant for regression on the outcomes.


contains one of currently two possible Strings to define the modelling approach of the regression coefficients, correlation structure between outcomes and the utility. Also will influence the treatment effects ("SF" - Shared Factor, "SWR" - Switching Regression)


contains a character vector, naming the covariates of the dataset.


a list of items controlling the mcmc parameters, see examples


a list with some general control parameters, the most important is control$sort_data which sorts the data for ids, treatment and panel times.


String which names the model, defaults to "model1"


boolean which indicates whether the baseline data and panel data should be organised by treatment and panel time. If the dataset is not yet sorted this option may sort data in correct format.


by default is NULL. If not NULL, has to be a vector of 0s and 1s with length matching the number of covariates in panel matrix. For the covariates indexed with 1, the model does not estimate different effects w.r.t. treatment, but assumes the covariate has an overall effect on the different panel outcomes.

There are 2 main objects necessary for computation of treatment effects, base_mat and panel_mat. base_mat contains a dataframe at the baseline (panel time 0) with specific features for latent utility computation. panel_mat is a dataframe containing information at panel times, including features that influence the panel outcomes. The datasets have to have certain properties. See example dataset for more information on how to prepare the dataset accordingly. For the datasets, the function first sets a lot of parameters influencing estimation and MCMC sampling process. For the time being this package includes the functionality of the Shared Factor Model. It may also be of interest to look at selectTreatmentSF to see how the function works.


For an adequate input file, bayesTrtEffects returns output a list object containing all coefficients of the model.

PatrickPfeifferDSc/bite documentation built on Aug. 22, 2019, 9:57 a.m.