help metandi postestimation                                     (Roger Harbord)
                                                             also see:  metandi


metandi postestimation -- postestimation tools for metandi


Many of Stata's standard postestimation tools will not work after metandi, or won't work as expected, as metandi reshapes the data before fitting the model.

The notable exception is predict, which can be used to obtain posterior predictions (empirical Bayes estimates) of the sensitivity and specificity in each study (mu), as well as various statistics that may be useful for detecting outliers (e.g. ustd) and influential observations (cooksd).

metandiplot graphs the results from metandi.

Syntax for predict

predict [type] newvarlist [if] [in] [, statistic]

where statistic is

mu posterior predicted (empirical Bayes) sensitivity and specificity; the default u posterior means (empirical Bayes predictions, BLUPs) of random effects sdu posterior standard deviations of the random effects ustd standardized posterior means of random effects linpred linear predictor with empirical Bayes predictions plugged in. linpred = xb + u cooksd Cook's distance for each study. Only available when model was fitted using gllamm.

Most of the above statistics require two new variables to store them, one for the statistic associated with sensitivity, and one for the statistic associated with specificity. If newvarlist contains only one newvar, the statistics associated with sensitivity and specificity will be stored in newvar1 and newvar0 respectively. cooksd, however, is computed once for each study and therefore requires only one newvar.


If the model was fitted using gllamm, the predictions are obtained using gllapred, whose help page contains further details of the statistics available. See also the GLLAMM manual (Rabe-Hesketh, Skrondal & Pickles 2004) and Rabe-Hesketh & Skrondal (2005). If the model was fitted using xtmelogit, the predictions are obtained using predict - see xtmelogit postestimation##predict.


. metandi tp fp fn tn

Add empirical Bayes estimates to metandiplot:

. predict eb

. metandiplot, addplot(scatter eb1 eb0)

Check for particularly influential observations using Cook's distance:

. predict cook, cooksd

. scatter cook studyid, mlabel(author)

Check for outliers using standardized predicted random effects (interpretable as standardized level-2 residuals):

. predict ustd_Se ustd_Sp, ustd

. scatter ustd_Se ustd_Sp, xscale(rev) mlab(studyid) xline(0) yline(0)

Also see

Online: gllapred, metandi, metandiplot