Basic graphics in Stata | Johan Osterberg - Product Engineer

Basic graphics in Stata

April 19, 2019

Stata offers basic graphic visualization, which can be useful to get grasp of the distribution of a variable. As evertything in Stata, it's possible to use the GUI, in this case it's available under the Graphics dropdown. However in my opinion it is almost always preferable to use the command editor. If we want to look at histogram of 1978 automobile prices, for instance:

sysuse auto, clear histogram price, percent ytitle(Percent) xtitle(Price) title(Histogram of automobile prices)

We are presented with a resulting histogram in a separate window. For this basic example we used a histogram, we chose percent for the y-axis, titles for the x- and y-axises as well as a title for the histogram:

Histogram of auto pries


Profile picture

Written by Johan Osterberg who lives and works in Gothenburg, Sweden as a developer specialized in e-commerce. Connect with me on Linkedin

2024 © Johan Osterberg