



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Revised July 2018 Bar Charts This set of notes shows how to construct a bar chart using Stata. It assumes that you have set Stata up on your computer (see the “Getting Started with Stata” handout), and that you have read in the set of data that you want to analyze (see the “Reading in Stata Format (.dta) Data Files” handout). In Stata, most tasks can be performed either by issuing commands within the “Stata command” window, or by using the menus. These notes illustrate both approaches, using the data file “GSS2016.DTA” (this data file is posted here: https://canvas.harvard.edu/courses/53958). Bar charts display differences in means for a quantitative variable across two or more groups, as opposed to histogram comparisons which display percentage distributions of a categorical variable within groups. For example, we can construct a bar chart of the mean hours per day of television viewing by self-attributed class:
Simple bar charts can be constructed easily via the Stata command line. The general command structure is graph bar
To further illustrate the use of these, the same bar chart is shown on the following page, with a title (at top) and a caption (bottom) added, and with a different title for the vertical (Y) axis.
Saving Graphs To save your bar chart(s), see the “Saving Graphs” handout.