Description Usage Arguments Value Examples
mstBayes
performs analysis of multisite randomised education trials using a multilevel model under a Bayesian setting
assuming vague priors.
1 2 3 4 5 6 7 8 9 10 11 
formula 
the model to be analysed is of the form y ~ x1+x2+.... Where y is the outcome variable and Xs are the independent variables. 
random 
a string variable specifying the "clustering variable" as contained in the data. See example below. 
intervention 
a string variable specifying the "intervention variable" as appearing in the formula and the data. See example below. 
baseln 
A string variable allowing the user to specify the reference category for intervention variable. When not specified, the first level will be used as a reference. 
adaptD 
As this function uses rstanarm, this term provides the target average proposal acceptance probability during Stanâ€™s adaptation period. Default is NULL. 
nsim 
number of MCMC iterations per chain. Default is 2000. 
data 
data frame containing the data to be analysed. 
threshold 
a scalar or vector of prespecified threshold(s) for estimating Bayesian posterior probability that the observed effect size is greater than or equal to the threshold(s). 
... 
additional arguments of 
S3 object; a list consisting of
Beta
: Estimates and credible intervals for variables specified in the model. Use summary.eefAnalytics
to get Rhat and effective sample size for each estimate.
ES
: Conditional Hedges' g effect size and its 95
covParm
: A list of variance decomposition into between cluster variancecovariance matrix (schools and school by intervention) and within cluster variance (Pupils). It also contains intracluster correlation (ICC).
SchEffects
: A vector of the estimated deviation of each school from the intercept and intervention slope.
ProbES
: A matrix of Bayesian posterior probabilities such that the observed effect size is greater than or equal to a prespecified threshold(s).
Model
: A stan_glm object used in ES computation, this object can be used for convergence diagnostic.
Unconditional
: A list of unconditional effect sizes, covParm and ProbES obtained based on between and within cluster variances from the unconditional model (model with only the intercept as a fixed effect).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31  if(interactive()){
data(mstData)
########################################################
## Bayesian analysis of cluster randomised trials ##
########################################################
output < mstBayes(Posttest~ Intervention+Prettest,random="School",
intervention="Intervention",nsim=2000,data=mstData)
### Fixed effects
beta < output$Beta
beta
### Effect size
ES1 < output$ES
ES1
## Covariance matrix
covParm < output$covParm
covParm
### plot random effects for schools
plot(output)
### plot posterior probability of an effect size to be bigger than a prespecified threshold
plot(output,group=1)
}

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.