*! midas_sforest.sthlp v1.0.0 Ben Adarkwa Dwamena 2026

Title

midas_sforest -- Summary forest plot with pooled diamond
for meta-analytical integration of diagnostic accuracy studies

Syntax

midas_sforest
[if] [in],
plottype(string)
[level(#)
mscale(#)
textscale(#)
combscale(#)
predinterval
ovline
cimethod(string)
cicolor(colorspec)
diamcolor(colorspec)
title(passthru)]

Required
plottype(string) plot style; one of generic,
ellipse, thick, or rain

Options
level(#) confidence level for interval bars; default
95

mscale(#) marker size scale factor; default 0.75;
passed as ms() to the internal sforest program

textscale(#) text size scale factor; default 1.0;
passed as text() to the internal sforest program

combscale(#) panel content scale for graph combine
via iscale(); default 0.5; smaller values shrink markers
and text within each combined panel

predinterval overlay the 95% prediction interval derived
from between-study heterogeneity

ovline draw a vertical reference line at the pooled
summary estimate

cimethod(string) confidence interval computation method;
exact (default), wilson, or wald

cicolor(colorspec) colour for confidence interval bars;
any Stata colorspec

diamcolor(colorspec) colour for the pooled summary diamond;
any Stata colorspec

title(passthru) graph title passed through to the plot

Description

midas_sforest is a post-estimation command in the MIDAS suite.
It produces a coupled summary forest plot — one panel for sensitivity
and one for specificity — in which each study contributes a point
estimate with confidence interval, and the pooled summary is rendered
as a filled diamond at the foot of each panel.

midas_sforest must be called after one of the five MIDAS
estimation commands:
midas_mle, midas_qrsim, midas_mh,
midas_hmc, or midas_inla.
It reads pooled estimates and study-level random effects from e().

The command requires the xsvmat package. If not installed, Stata
will prompt you to install it from SSC:
ssc install xsvmat, replace.

For a pre-estimation exploratory forest plot without a summary diamond,
see midas_eforest. For per-study heterogeneity decomposition,
see midas_het.

Options

Required

plottype(string) specifies the visual style of the forest plot.
Must be one of generic, ellipse, thick, or rain.
See Plot types for descriptions.

Display

level(#) sets the confidence level. Default is 95 for 95%
confidence intervals. Must be an integer between 10 and 99.

mscale(#) scales all markers proportionally. Default is 0.75.
Increase for larger markers; reduce for dense plots with many studies.

textscale(#) scales all text elements in the plot proportionally.
Default is 1.0.

combscale(#) sets the iscale() argument passed to
graph combine. This controls the proportional size of text and
markers within each panel of the combined two-panel plot. Default is
0.5. Smaller values produce more compact panels.

predinterval adds a 95% prediction interval to each panel,
representing the range of true sensitivity or specificity expected in a
new study given the estimated between-study heterogeneity. This option
is particularly informative when heterogeneity is high.

ovline adds a vertical reference line at the pooled summary value
in each panel.

cimethod(string) specifies the method for computing per-study
confidence intervals for the forest plot bars. Options are exact
(Clopper-Pearson; default), wilson, and wald.

cicolor(colorspec) sets the colour of the confidence interval
bars. Accepts any valid Stata colour specification, including RGB
triplets such as "51 105 173".

diamcolor(colorspec) sets the colour of the pooled summary
diamond. Accepts any valid Stata colour specification.

Plot types

The plottype() option selects from four visual styles:

generic — standard horizontal dot-and-bar forest plot.
Each study is a filled circle with a horizontal confidence bar.
This is the default style and is appropriate for most publications.

ellipse — study weights are encoded as filled ellipses
whose width is proportional to the study's precision weight.
Useful for emphasising the influence of large studies.

thick — confidence bars are rendered as thick filled
rectangles rather than thin lines, giving a more visually prominent
display of the uncertainty range.

rain — a raincloud-style plot combining dot estimates
with a half-density representation of the distribution of study
estimates. Particularly useful for visualising the spread of
heterogeneous results.

Examples

Basic usage after MLE — generic plot

. use fdgpet_axillary, clear

. midas_mle tp fp fn tn, id(author) year(year)

. midas sforest, plottype(generic)

Ellipse plot with prediction interval

. midas sforest, plottype(ellipse) predinterval

Rain plot with 90% CI and overall reference line

. midas sforest, plottype(rain) level(90) ovline

Custom colours and compact panels

. midas sforest, plottype(generic) cicolor("100 150 200") diamcolor("200 80 50") combscale(0.4)

After HMC estimation

. midas hmc tp fp fn tn, id(author) modelfile("model.stan") chains(4) iter(2000)

. midas sforest, plottype(thick) predinterval ovline

References

Dwamena, B. A. (2009).
MIDAS: Meta-analytical Integration of Diagnostic Accuracy Studies.
Statistical Software Components, Boston College Department of Economics.
https://ideas.repec.org/c/boc/bocode/s456880.html

Reitsma, J. B., Glas, A. S., Rutjes, A. W. S., Scholten, R. J. P. M.,
Bossuyt, P. M., and Zwinderman, A. H. (2005).
Bivariate analysis of sensitivity and specificity produces informative
summary measures in diagnostic reviews.
Journal of Clinical Epidemiology 58(10): 982-990.

Higgins, J. P. T., Thompson, S. G., Deeks, J. J., and Altman, D. G.
(2003).
Measuring inconsistency in meta-analyses.
BMJ 327: 557-560.

Riley, R. D., Higgins, J. P. T., and Deeks, J. J. (2011).
Interpretation of random effects meta-analyses.
BMJ 342: d549.

Author

Ben Adarkwa Dwamena, MD

Clinical Associate Professor Emeritus of Radiology

(Nuclear Medicine and Molecular Imaging)

University of Michigan

East Lansing, Michigan, USA

bdwamena@umich.edu

Please report bugs and suggestions via the MIDAS SSC page or by email.

Also see: midas_mle, midas_qrsim, midas_mh,
midas_hmc, midas_inla, midas_eforest,
midas_het