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

Title

midas_het -- Post-estimation heterogeneity decomposition
for meta-analytical integration of diagnostic accuracy studies

Syntax

midas_het
[,
savegraph(filename)
nograph
format(fmt)]

Output
savegraph(filename) save forest plot to filename.pdf
and filename.eps; no extension in filename

nograph suppress the forest plot; tabular output still
produced

format(fmt) Stata numeric display format for I² columns;
default %6.4f

Description

midas_het is a post-estimation command in the MIDAS suite. It
decomposes overall heterogeneity into study-specific contributions using
Burke-weighted apportionment and presents results as a formatted table and
a forest-plot style chart.

midas_het must be called immediately after one of the five MIDAS
estimation commands:
midas_mle, midas_qrsim, midas_mh,
midas_hmc, or midas_inla.
It reads matrices and scalars from e() and does not modify the
original estimation results except to add the decomposition matrices
listed under Stored results.

midas_het is distinct from midas_assess, which is a
pre-estimation exploratory command for data quality evaluation,
threshold analysis, SROC shape assessment, and publication bias checks.
midas_het is strictly post-estimation.

Options

Output

savegraph(filename) exports the forest plot in two formats:
filename.pdf for screen and print, and filename.eps
for import into LaTeX (via \includegraphics). Specify the path
without an extension. Example: savegraph("plots/i2_forest").
Existing files are silently replaced.

nograph suppresses the forest plot entirely. Useful in batch
processing or when only the e() matrices are required.

format(fmt) sets the Stata display format applied to I²
contribution columns in the tabular output. The default %6.4f
gives four decimal places. Use %8.6f for higher precision or
%5.1f for a more compact table.

Workflow

The standard MIDAS analysis sequence is:

Step 1 — Pre-estimation diagnostics

. midas_assess tp fp fn tn [, options]

Step 2 — Estimation

. midas_mle tp fp fn tn [, options]

(or midas_qrsim, midas_mh, midas_hmc,
midas_inla)

Step 3 — Post-estimation heterogeneity decomposition

. midas_het [, options]

midas_het requires an active e() from Step 2. If another
estimation command is run between Steps 2 and 3, e() will be
overwritten and midas_het will exit with an error.

Methods and formulas

Burke-weighted apportionment

Let n be the number of primary studies and let
W be the n×3 matrix of Burke weights posted by the estimator in
e(studywgts), with columns indexing sensitivity (j=1),
specificity (j=2), and the bivariate composite (j=3).

Let I²(j) denote the overall heterogeneity statistic for
component j, stored in e(bIsquared).

The apportioned I² contribution of study i to component j is:

H[i,j] = ( W[i,j] / {sum_i W[i,j]} ) × I²(j)

where the sum in the denominator runs over all n studies. H[i,j]
is expressed in percentage points and sums exactly to I²(j)
over studies.

The percentage share of study i in component j is:

Hpct[i,j] = 100 × H[i,j] / I²(j)

which sums to 100 over studies for each j.

I² computation — Zhou-Dendukuri method

The overall I²(j) values in e(bIsquared) are computed
uniformly across all five MIDAS estimators using the Zhou-Dendukuri
method for quantifying heterogeneity in bivariate meta-analyses of
binary data. This method accounts for the bivariate structure of
sensitivity and specificity and is applied consistently regardless of
the estimation approach (MLE, quadrature, Bayesian MH, HMC, or INLA).

Reference: Zhou Y, Dendukuri N. Statistics for quantifying
heterogeneity in univariate and bivariate meta-analyses of binary
data: the case of meta-analyses of diagnostic accuracy.
Statistics in Medicine. 2014;33(16):2701-2717.

Weight column sums

The audit matrix e(wtcheck) records the raw column sums of W
before normalisation. Under normalised weights these equal 1; under
raw precision weights they equal the total precision for each component
and serve as a consistency check.

Weight provenance by estimator

The Burke weights differ across estimators in their derivation method.
The I² target is uniform across all five estimators: the
Zhou-Dendukuri method (2014). midas_het records weight
provenance in its tabular footer.

mle Model-based posterior precision weights from the
bivariate GLMM fitted via meglm. Three adaptive
Gauss-Hermite integration methods are supported:
mean-variance adaptive (mvaghermite, default),
mode-curvature adaptive (mcaghermite), and
Pinheiro-Chao mode-curvature adaptive (pcaghermite).
Weights are the inverse conditional variance of study-specific
random effects at the AGH estimates; see
Pinheiro and Chao (2006).

qrsim Model-based posterior precision weights from the
bivariate GLMM fitted by maximum simulated likelihood using
quasi-random Monte Carlo simulation with Halton sequences.
Weights are the inverse conditional variance of study-specific
random effects at the MSL estimates. Convergence to the true
posterior precision improves with the number of simulation
draws.

mh Posterior mean precision weights from the Bayesian
Metropolis-Hastings model fitted via bayesmh. Weights are
derived from Metropolis-Hastings draws; between-study covariance
enters through the prior structure rather than a GLMM variance
component.

hmc Full posterior precision weights from Hamiltonian Monte
Carlo chains via CmdStan. These weights integrate over the full
posterior of the between-study covariance matrix, whereas mle
conditions on point estimates of variance components. For small n the
two can differ materially.

inla Marginal posterior precision weights from the INLA
Laplace approximation. The I² target is computed by the same
Zhou-Dendukuri method as all other estimators.

Stored results

midas_het adds the following matrices to e(). All
pre-existing estimation results are preserved.

Matrices
e(studywgts) n×3 matrix of Burke precision weights;
columns are senwgt, spewgt, bivwgt; rows labelled by
study identifier; all five MIDAS estimators post under this name with
these column names

e(bIsquared) 1×3 row vector of overall I²
values; columns are I2_sens, I2_spec, I2_biv

e(studyI2) n×3 matrix of apportioned I²
contributions in percentage points; columns are I2_sens_contrib,
I2_spec_contrib, I2_biv_contrib

e(studyI2pct) n×3 matrix of percentage shares;
columns are I2_sens_pctpt, I2_spec_pctpt,
I2_biv_pctpt

e(wtcheck) 1×3 row vector of weight column sums for
audit; columns are senwgt_sum, spewgt_sum,
bivwgt_sum

Tabular output

The table displays one row per study with six numeric columns grouped
into three pairs — one pair per component (sensitivity, specificity,
bivariate). Within each pair the first column gives the absolute
I² contribution in percentage points and the second gives the
study's percentage share of the overall I² for that component.

The footer rows show:

Overall I² — the target values being apportioned;
each percentage share column reads 100.

Weight column sums — raw sum of Burke weights per
component; serves as an arithmetic audit.

The footer notes record the weight source, the I² source, and
any estimation-specific caveats (currently applied to inla only).

Forest plot

The forest plot displays, for each study, three horizontal spike-and-dot
series — one per component — offset vertically by 0.22 units so
the three series are legible without overlap. Studies are ordered top
to bottom in the order they appear in the data (study 1 at top).

Each spike runs from zero to the study's I² contribution
(rcap, horizontal). The filled marker at the tip encodes the
component: circle (sensitivity), diamond (specificity), triangle
(bivariate).

Three dashed vertical reference lines mark the overall I² for
each component. The overall values are annotated at the top of each
reference line.

The subtitle records the estimator name and a note about the reference
lines.

Colors: sensitivity = blue (51 105 173); specificity = coral
(205 92 55); bivariate = green (67 135 80). These match the
MIDAS house palette used in midas_bvsroc and midas_bivbox.

Examples

Basic usage after MLE

. use fdgpet_axillary, clear

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

. midas_het

Save graph for LaTeX (plots/ subdirectory)

. midas_het, savegraph("plots/i2_forest")

Tabular output only, higher precision

. midas_het, nograph format("%8.6f")

After HMC estimation

. midas_hmc tp fp fn tn, id(author) iter(2000)

. midas_het, savegraph("plots/i2_hmc")

Access stored matrices after midas_het

. matrix list e(studyI2)

. matrix list e(studyI2pct)

. matrix list e(wtcheck)

Export contribution matrix to dataset

. matrix H = e(studyI2)

. svmat H, names(col)

References

Burke, D. L., Ensor, J., Snell, K. I. E., van der Windt, D., and
Riley, R. D. (2018).
Guidance for deriving and presenting percentage study weights in
meta-analysis of test accuracy studies.
Research Synthesis Methods 9(2): 163–178.

Riley, R. D., Ensor, J., Jackson, D., and Burke, D. L. (2018).
Deriving percentage study weights in multi-parameter meta-analysis
models: with application to meta-regression, network meta-analysis
and one-stage individual participant data models.
Research Synthesis Methods 9(2): 145–157.

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

Harbord, R. M., and Whiting, P. (2009).
metandi: Meta-analysis of diagnostic accuracy using hierarchical
logistic regression.
Stata Journal 9(2): 211–229.

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

Pinheiro, J. C., and Chao, E. C. (2006).
Efficient Laplacian and adaptive Gaussian quadrature algorithms
for multilevel generalized linear mixed models.
Journal of Computational and Graphical Statistics 15(1): 58–81.

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.

Rutter, C. M., and Gatsonis, C. A. (2001).
A hierarchical regression approach to meta-analysis of diagnostic
test accuracy evaluations.
Statistics in Medicine 20(19): 2865–2884.

Zhou, Y., and Dendukuri, N. (2014).
Statistics for quantifying heterogeneity in univariate and bivariate
meta-analyses of binary data: the case of meta-analyses of diagnostic
accuracy.
Statistics in Medicine 33(16): 2701–2717.

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_assess