*! version 2.1 May 2026
help mmqregplot

Title

mmqregplot -- Beautiful visualization suite for mmqreg results

Syntax

mmqregplot [varlist] [, options]

options

Equation selection
eqplot(string) which result to visualize:

qtile (default) — quantile path plots across the distribution

location — horizontal coefplot of location (mean) equation

scale — horizontal coefplot of scale equation

all — all three panels combined

Color scheme
colorscheme(string) color palette preset:

navy (default), viridis, autumn, warm, mono, teal

Quantile range (for eqplot=qtile or all)
quantile(numlist) quantiles to plot (0–100); default is 10(5)90

OLS reference line
ols add an OLS coefficient line and confidence band

olsopt(string) options passed to regress for OLS overlay

Fixed effects / Country effects
feplot add a panel showing the distribution of absorbed
fixed effects (requires absorb() in mmqreg)

festyle(string) style for feplot:

bar (default, ≤60 units) — sorted horizontal bars, blue=positive/red=negative

hist — histogram with KDE overlay

dot — Cleveland-style dot plot

Graph styling
raopt(string) rarea CI band options (overrides colorscheme defaults)

lnopt(string) coefficient line options (overrides colorscheme defaults)

twoopt(string) options applied to every twoway panel

grcopt(string) options for the final graph combine

nozero suppress the zero reference line

Labels and titles
label use variable labels as subplot titles

mtitles(string) space-separated quoted panel titles (override)

cons include the constant as an additional subplot

level(#) confidence level; default is 95

Graph display and saving
showall draw every panel directly (no hidden nodraw); each panel
stays in memory; the combined figure is produced last

keepgraphs keep individual panels in memory after combining
(otherwise dropped)

nocombine skip the graph combine step entirely — display
each panel one by one

saving(prefix) save every panel and the combined figure as
.gph files using prefix; e.g. saving("out/wage") writes
out/wage_mmqp1.gph, out/wage_mmqloc.gph, out/wage.gph, etc.

gformat(formats) additional image formats to export (space-separated);
e.g. gformat(png pdf)

Description

mmqregplot (v2.1) is a comprehensive visualization suite that must be
run immediately after mmqreg. It offers four plot types:

1. Quantile path plots (eqplot(qtile), default)

Re-estimates the model across the requested quantile range and draws the
coefficient path with a shaded CI band. Optional OLS overlay.

2. Location equation coefplot (eqplot(location))

Horizontal dot-and-spike plot of the location (mean) equation coefficients
using the stored e(bls) and e(vls) — no re-estimation needed.

3. Scale equation coefplot (eqplot(scale))

Same as location but for the scale (dispersion) equation.

4. Combined (eqplot(all))

Location + Scale + quantile path panels assembled with graph combine.

5. Fixed effects / Country effects (feplot)

Visualize the distribution or ranking of absorbed unit-specific effects.
Supports sorted bar chart (default for ≤60 units), histogram with KDE (festyle(hist)),
and Cleveland dot plot (festyle(dot)).

Color schemes are controlled by colorscheme(): navy (default),
viridis, autumn, warm, mono, teal.

Graph names

Every panel is created as a named graph held in Stata's memory:

mmqp1, mmqp2, ... quantile-path panel for the
nth variable (one per requested variable)

mmqloc location coefplot (when eqplot(location) or all)

mmqsca scale coefplot (when eqplot(scale) or all)

mmqfe fixed-effects panel (when feplot)

mmqcombined final combined figure

By default, individual panels are dropped after combining (only
mmqcombined remains visible). Pass keepgraphs or showall to
keep them all in memory so you can browse with
graph display mmqp1, graph display mmqloc, etc.

Saving figures to disk

The saving(prefix) option saves every panel plus the combined figure
as Stata graph files (.gph). Add gformat() to also export images
in any format Stata supports (png, pdf, jpg, eps, tif, svg). Example:

. mmqregplot, eqplot(all) saving("out/wage") gformat(png pdf)

produces out/wage_mmqp1.gph, out/wage_mmqloc.gph,
out/wage_mmqsca.gph, out/wage.gph — and a .png and
.pdf copy of each.

Examples

Setup

webuse nlswork, clear

xtset idcode year

1. Quantile coefficient paths (default)

mmqreg ln_w age ttl_exp tenure not_smsa south

mmqregplot

2. With OLS overlay and viridis color scheme

mmqregplot age ttl_exp tenure, ols colorscheme(viridis)

3. Location equation coefplot

mmqreg ln_w age ttl_exp tenure not_smsa south, q(25 50 75)

mmqregplot, eqplot(location) colorscheme(autumn)

4. Scale equation coefplot

mmqregplot, eqplot(scale)

5. All equations combined (location + scale + paths)

mmqregplot age ttl_exp tenure, eqplot(all) colorscheme(teal) ols

6. Country/unit fixed effects — bar chart

mmqreg ln_w age ttl_exp tenure, absorb(idcode)

mmqregplot, feplot festyle(bar) colorscheme(warm)

7. FE histogram with KDE

mmqregplot, feplot festyle(hist)

8. All equations + country effects in one figure

mmqreg ln_w age ttl_exp tenure, absorb(idcode) q(25 50 75)

mmqregplot age ttl_exp tenure, eqplot(all) feplot colorscheme(navy) ols

9. Mono scheme for publication

mmqregplot age, eqplot(all) colorscheme(mono) level(90) nozero

10. Show every panel individually, with a combined summary at the end

mmqregplot age ttl_exp tenure, eqplot(all) showall

11. Save all panels + combined to PNG and PDF

`"mmqregplot age ttl_exp tenure, eqplot(all) ols saving("out/wage") gformat(png pdf)"'

12. Keep panels in memory and browse them manually

mmqregplot, eqplot(all) keepgraphs

graph display mmqloc

graph display mmqsca

graph display mmqp1

Returned results

mmqregplot returns the following in r():

r(qq) matrix of quantile values plotted

Authors

Fernando Rios-Avila (original mmqreg)

friosa@gmail.com

Dr Merwan Roudane (mmqregplot companion)

merwanroudane920@gmail.com

Also see

mmqreg, qregplot, twoway, graph combine