mstbayes -- Bayesian Effect Size calculation for Multisite Randomised Trials

Syntax

mstbayes varlist [if] [in], intervention(interv_var) random(clust_var) [options]

main

intervention() requires a factor variable identifying the intervention (arms) of the trial.

random() requires a factor variable identifying the clusters (Schools) of the trial.

Model
* additional Bayesian arguments to be passed to the command. Stata defaults apply.

Reporting
threshold(#) a real scalar or vector of threshold(s) for estimating Bayesian posterior probability.

sepchains stores summary statistics for each chain.

diagnostics generates convergence diagnostic graphs.

noisily displays regression output.

save saves the simulation output.

cond() wrapper for bayesian arguments specified only for the conditional model.

uncond() wrapper for bayesian arguments specified only for the unconditional model.

varlist and intervention() may contain factor-variable operators; see fvvarlist.

Description

mstbayes performs Effect Size (ES) calculation of multisite randomised educational trials using a multilevel model under a Bayesian setting. This analysis produces ES estimates for both conditional
and unconditional model specifications.

Options

Model

* Additional Bayesian arguments to be passed to the command such as mcmcsize(#) burnin(#) rseed(#) nchains(#) and custom priors. Stata defaults of Bayesian mixed models apply; see bayes prefix ([BAYES] bayes).

Reporting

threshold(#) A real scalar or vector for estimating Bayesian posterior probability such that the observed effect size is greater than or equal to the threshold(s).

sepchains Stores summary statistics for each number of chains specified in nchains(#).

diagnostics Generates convergence diagnostic graphs for each number of chains specified in nchains(#).

noisily Displays regression output for both conditional and unconditional models.

save Saves simulation output in two datasets (mcmcCondMST.dta, mcmcUncMST.dta) for the conditional and unconditional models respectively.

cond() Bayesian arguments are passed only to the conditional model; default is bayesian arguments are included in both models.

uncond() Bayesian arguments are passed only to the unconditional model; default is bayesian arguments are included in both models.

Examples

Setup:

. use mstData.dta, clear

Simple model:

. mstbayes Posttest Prettest, int(Intervention) ran(School)

Model using custom simulation options and all diagnostic options with base level change:

. mstbayes Posttest Prettest, int(ib(last).Intervention) ran(School) thr(0.1) mcmcsize(50000) burnin(50000) rseed(1234) nchains(4) sepch diag save

Model using custom simulation options with three-arm intervention variable and custom priors:

. mstbayes Posttest Prettest, int(Intervention2) ran(School) mcmcsize(50000) burnin(50000) rseed(1234) nchains(4) prior(_cons, uniform(-50,50))

Model using custom simulation options and custom conditional model prior:

. mstbayes Posttest Prettest, int(Intervention) ran(School) mcmcsize(50000) burnin(50000) rseed(1234) nchains(4) cond(prior( 1.Intervention, normal(0.5,1)))

Stored results

mstbayes stores the following in r():

Matrices

r(CondES#) conditional Hedges’ g effect size and its 95% credible intervals for # number of arms in interv_var.

r(UncondES#) unconditional effect size for # number of arms in interv_var, obtained based on within and total variance from the unconditional model.

r(Beta) estimates and credible intervals for variables specified in the model.

r(Cond_ProbES#) a matrix of Bayesian Posterior Probabilities for the conditional model, such that the observed effect size is greater than or equal to a pre-specified threshold(s) for arm #.

r(Uncond_ProbES#) a matrix of Bayesian Posterior Probabilities for the unconditional model, such that the observed effect size is greater than or equal to a pre-specified threshold(s) for arm #.

r(Cov) variance decomposition into within cluster variance (Pupils) and Total variance. It also contains intra-cluster correlation (ICC).

r(schCov) variance decomposition into between cluster variance-covariance matrix (school by intervention).

r(UschCov) variance decomposition for the Unconditional model into between cluster variance (School).

r(SchEffects) a vector of the estimated deviation of each school from the intercept.

r(sepchains_#) stores summary statistics for # number of chains separately.