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.
1 2 3 4 5 6 | 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")
|
base_mat |
a data frame or matrix file, containing id, maximum panel time on each subject, the treatment indicator and the baseline features. |
panel_mat |
a data frame of matrix file, containing id, panel times per subject, the panel outcomes and other features, relevant for regression on the outcomes. |
type |
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) |
covars |
contains a character vector, naming the covariates of the dataset. |
mcmc_control |
a list of items controlling the mcmc parameters, see examples |
control |
a list with some general control parameters, the most important is control$sort_data which sorts the data for ids, treatment and panel times. |
model_name |
String which names the model, defaults to "model1" |
sort_data |
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. |
cov_y_common |
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 |
For an adequate input file, bayesTrtEffects
returns output a list
object containing all coefficients of the model.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.