stripplot

Better dotplots for Stata

stats
Stata
teaching
dataviz
Author

Andy Grogan-Kaylor

Published

May 20, 2026

Background

For a recent project, we have been working with a lot of Likert scale data (e.g. “strongly disagree”, “disagree”, “neutral”, “agree”, “strongly agree”). Many times we are averaging several questionnaire items into a summary score e.g. generate myaverage = (Q1 + Q2 + Q3)/3.

I’ve been thinking about the best way to visualize these distributions of scale scores. Stata offers histograms, kernel densities and dotplots, none of which seem 100% intuitive or satisfactory. dotplots are intuitive in that every person is represented by a dot, but the fact that they are turned sideways in Stata seems unsatisfactory and counter-intuitive to me.

Show the code
clear all // clear data

set obs 100 // 100 observations

generate myaverage = runiform(1, 5) // randomly simulated score

histogram myaverage

graph export "myhistogram.png", replace

kdensity myaverage

graph export "mydensity.png", replace

dotplot myaverage

graph export "mydotplot.png", replace

histogram

histogram

density

density

dotplot

dotplot

stripplot

I’ve come to like stripplot (Cox, 2003) as a more intuitive alternative to the above plots. stripplot requires a few options to make the plot I want, but is very useful.

Show the code
stripplot myaverage, ///
stack /// stack the dots
width(1) /// bin with width 1
msymbol(circle) /// symbols are circles
title("Scale 1") /// title
xtitle("Scale 1") /// title for x axis
xlabel(1 "strongly disagree" 2 "disagree" 3 "neutral" 4 "agree" 5 "strongly agree", labsize(vsmall)) // customize labels

graph export "mystripplot.png", replace

stripplot

stripplot

Adjusting the Bin Width

The width of the bins that stripplot uses can be adjusted with the width() option to adjust the resolution of the graph.

Show the code
stripplot myaverage, stack width(.25) msymbol(circle)

graph export "mystripplotA.png", replace

stripplot myaverage, stack width(.5) msymbol(circle)

graph export "mystripplotB.png", replace

stripplot myaverage, stack width(1) msymbol(circle)

graph export "mystripplotC.png", replace

binning with width(.25)

binning with width(.25)

binning with width(.5)

binning with width(.5)

binning with width(1)

binning with width(1)

References

Cox, N. J. (2003). STRIPPLOT: Stata module for strip plots (one-way dot plots) (No. S433401). https://ideas.repec.org/c/boc/bocode/s433401.html