graph violin
A density curve per group, mirrored so each group gets a shape. A box plot shows you five numbers; this shows you the whole distribution, including a second peak a box would hide.
What we have
- statistics:
count,max,mean,median,min,sum over()for the categories andby()for a second splittitle(),ytitle()andsaving()- one self-contained
.htmlfile: no server, no internet, nothing to install - a table view beside the chart, so the numbers can be read off
Coming later
- saving as PNG or SVG —
graph exportdoes not exist yet graph twowayandgraph matrix, which are refused- 84 more of the 105 catalogue chart types
How you write it
graph violin varname [if] [weight], [over(catvar)] [bwidth(#)]
A density shape for each group, with its median.
What your data has to look like
One row per person or record, with these columns (named here as they are in vira.sample01):
| Column | Holds | What it does in the chart |
|---|---|---|
sector | a category | optional: one shape for each value |
mpce | a number | the values each shape smooths |
Three rows of it would look like this:
Rural 2410.55 Urban 4102.8 Rural 2988.1
The example
. sysuse vira.sample01, clear . graph violin mpce, over(sector)
That is the real file the command wrote — open it on its own. It is one self-contained page with no internet connection needed, so you can email it or drop it into a report.