R/create_clustermatrix.R
create_clustermatrix.RdThis function creates a posterior clustering matrix for the interventions in the form of a ggplot.
create_clustermatrix(mcmc, names = NULL, label_ranks = NULL)MCMC draws from the RaCE NMA model, in the form of the model output of the mcmc_RCMVN function.
A vector of intervention names (optional)
A vector containing rank levels for which posterior rank probabilities should be displayed within the clustering matrix. Defaults to NULL, indicating no probabilities are displayed as text.
A ggplot of a posterior clustering matrix for the interventions.
mcmc <- mcmc_RCMVN(ybar=c(0,0,1,1), s=c(.1,.1,.1,.1), mu0=0.5, sigma0=5, tau=0.5,chains=2,seed=1)
#> [1] "Estimating chain 1 of 2."
#> [1] "Estimating chain 2 of 2."
create_clustermatrix(mcmc,names=paste0("Treatment ",1:4),label_ranks=c(1,3))
#> Warning: `label` cannot be a <ggplot2::element_blank> object.