Stata tip 81: A table of graphs

Maarten L. Buis and Martin Weiss

The Stata Journal (2009) Vol. 9 No. 4, pp. 643-647.


Stata's graph command has the by() option, which makes it possible to display the same graph for multiple groups in a single graph. These groups are specified by one or more categorical variables. This tip discusses ways in which one can fine tune such a display to create a tabular look for such a graph where the "rows" represent one categorical variable and the "columns" another.

The two main issues are: 1) How to make sure that the sub-graphs in the rows and columns are properly aligned and how to display empty sub-graphs, and 2) how to create "column titles" and "row titles" instead of labelling each sub-graph individually.

link to full-text