Basic graphs
Another useful way of analyzing descriptive information is to depict them in a graphical representation. The following sections introduce the basic graphs and diagrams:
- Bar graphs
- Box plots
- Pie charts
- Twoway graphs (scatter & line graphs)
- Histograms Additionally, there are two practical sections on:
- Overlaying & combining graphs
- Saving & exporting graphs
General command:
- Almost all the above graphs are created via the command graph - familiarize yourself with the help file and its specific sub-sections as many general options are similar across graph types.
Note on editing graphs:
- Stata allows you do create graphs using Stata's interface or by writing Stata code. The latter option is preferred as you do not have to repeat every step by hand if something in your data changes
- However, you can use the interface to learn about the syntax of a graph command, as Stata displays the corresponding code even if you create a graph via the interface
Once you have gone through the basic graphs and options, there is a nice overview by DIME Analytics on how to use the different graph types including Stata code. To become a pro, you can learn much more about making graphs in Stata on the blog by Asjad Naqvi, for example a step-by-step guide to customize the look of standard graphs. Also check out this overview on Stata visualizations by Fahad Mirza.
You can download the complete dofile below and go through it step by step in the sections.