Click here to download Stata commands
/*Install the packages*/
net install mvmeta.pkg, from(http://fmwww.bc.edu/RePEc/bocode/m)
net install network.pkg, from(http://fmwww.bc.edu/RePEc/bocode/n)
net install st0411.pkg, from(http://www.stata-journal.com/software/sj15-4)
net install sencode.pkg, from(http://fmwww.bc.edu/RePEc/bocode/s)
/* Binary Data */
/*NMA for binary data*/
/*Setup the working directory and load the data*/
cd "D:\NMA_D2\"
use "P1_long.dta", clear /*For loading long form data*/
use "P1_wide.dta", clear /*For loading wide form data*/
/* Construct a new dataset ready for NMA */
network setup d n, studyvar(study) trtvar(iv) or /*For long form data*/
network setup d n, studyvar(study) or /*For wide form data*/
/* Draw a network geometry */
network map
/* Fit a consistency model by showing exponential results (OR) */
network meta c, eform /* Use "eform" to show OR instaed of logOR*/
lincom [_y_C]_cons - [_y_B]_cons, eform /* Obtain OR of Q vs NQ*/
/* Draw a forest plot with exponential results (OR) and diamond for pooled results */
network forest, list eform xlabel(0.01 0.1 1 10 100) diamond
/* Draw a ranking plot */
network rank min, all gen(prob) line cumulative
sucra prob*, labels(A NQ Q) rankog
/* Check inconsistency using side-split*/
network sidesplit all
/* Check inconsistency using inconsistency model*/
network meta i, eform
/* Draw a forest plot with exponential results (OR) and diamond for pooled results */
network forest, list eform xlabel(0.01 0.1 1 10 100) diamond
/* Continuous Data */
/*NMA for Continuous data*/
/*Setup the working directory and load the data*/
cd "D:\NMA_D2\"
use "P5_continous_long.dta", clear /* For loading long form data */
use "P5_continous_wide.dta", clear /* For loading wide form data */
/* Construct a new dataset ready for NMA */
network setup mean sd n, studyvar(study) trtvar(trt) md trtlist("P" "D" "G") /*For long form data*/
network setup mean sd n, studyvar(study) md trtlist("P" "D" "G") /*For wide form data*/
/* Draw a network geometry */
network map
/* Fit a consistency model by showing exponential results (OR) */
network meta c
lincom [_y_C]_cons - [_y_B]_cons /* Obtain MD of G vs D */
/* Draw a forest plot with exponential results (OR) and diamond for pooled results */
network forest, list diamond
/* Draw a ranking plot */
network rank min, all gen(prob) line cumulative
sucra prob*, labels("P" "D" "G") rankog
/* Check inconsistency using side-split*/
network sidesplit all
/* Check inconsistency using inconsistency model*/
network meta i
/* Draw a forest plot with exponential results (OR) and diamond for pooled results */
network forest, list diamond