This page presents examples of graphics programs written by Nicholas J. Cox (Durham University). You can obtain these programs by typing, findit command_name, into the Stata command line and following the instructions (see How can I use the findit command to search for programs and get additional help? for more information about using findit). This page is not an exhaustive list of all of the graphics commands written by Nick Cox but merely a collection of the ones that we use most frequently. The command ssc install njc_stuff will download two help files listing all programs written by Nick Cox including his graph commands.asciiplot-- graph ASCII character set in current graph fontThis page contains only the commands and the plots themselves, there is no further explanation. We envision that users will look through the plots and when they find one that appears to do what they want, they will download the program and carefully read the help files.
Most of these examples use the hsb2 dataset which can be downloaded from within Stata using the following command:
use http://www.ats.ucla.edu/stat/stata/notes3/hsb2, clearNote: Most of the graphs were produced using the scheme lean1. Whenever a different scheme is used, it is given in the command.
asciiplot
anova write female prog female*prog anovaplot prog femaleanovaplot prog female, scatter(msym(i))
beamplot writebeamplotplot write, over(female)
binsm write read, width(5) scatter(jitter(2))
catplot prog racecatplot prog race, by(female)
ciplot write science, by(female)
corrtable read write math science
cpyxplot write read \ math science
diagsm write math
distplot writedistplot write, over(female)
doublesm write math
dpplot write
eqprhistogram write, mean
fractileplot write read math science socst
regress write read indexplot, show(cooksd) hi(3)indexplot, show(rstandard) base(0)
kaplansky
mlowess write read math science socst
mrunning write read math
regress write read ovfplotregress write read female ovfplot, by(female)
pairplot write science in 1/30pairplot write science in 1/30, diff
parplot female write science
pdplot prog
polarsm write read, over(female) by(female)
ppplot connected write, by(female) ref(0)ppplot connected write math
qplot write
rcspline write read
regress write read rdplot, g(3)
regress write read regplotgenerate write2 = write^2 regress math write write2 regplot
regress write read female regplot, by(female) scheme(s2mono)
regress write read rhetplot, by(prog female)
running write read, scatter(jitter(2))
regress write read female rvfplot2, rstandard yline(0)
regress write read female rvpplot2 read, rstandard yline(0)
skewplot math
slideplot bar female, pos(1) neg(0) by(prog)
spineplot ses femalespineplot ses female, bar1(color(gs14)) bar2(color(gs10)) bar3(color(gs6))spineplot race ses
stemplot ses femalestemplot write, d(2) by(female) back scheme(s2mono)
generate pipe = "|" stripplot write, over(prog) mlabel(pipe) mlabpos(0) msymbol(i)
use http://www.ats.ucla.edu/stat/stata/notes/lahigh egen mabs = mean(daysabs), by(school gender) tableplot rbar mabs school gender
tabplot ses female, showval percent(female)
The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California.