Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Constructing Bar Charts in Stata: A Step-by-Step Guide, Exercises of Sociology

Data AnalysisStatisticsData Visualization

Instructions on creating bar charts using Stata software. It covers both command-line and menu-based approaches, using the 'GSS2016.DTA' dataset as an example. Bar charts display mean differences for a quantitative variable across groups, while histograms show percentage distributions of categorical variables. how to create simple bar charts and enhance their appearance with titles, subtitles, and custom axis labels.

What you will learn

  • What is the difference between bar charts and histograms in Stata?
  • How do I create a simple bar chart in Stata using the command line?
  • How can I add enhancements, such as titles and axis labels, to my Stata bar chart?

Typology: Exercises

2021/2022

Uploaded on 08/01/2022

hal_s95
hal_s95 🇵🇭

4.4

(620)

8.6K documents

1 / 5

Toggle sidebar

Related documents


Partial preview of the text

Download Constructing Bar Charts in Stata: A Step-by-Step Guide and more Exercises Sociology in PDF only on Docsity! 1 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: 2 Simple bar charts can be constructed easily via the Stata command line. The general command structure is graph bar <varname1>, over(<varname2>) where you enter a quantitative variable in place of “varname1" and a categorical variable in place of “varname2". Using the variables in the above graph, you would issue the command graph bar tvhours, over(class) This command produces a bare-bones graph with no enhancements. To enhance and improve the display, it is probably easier to use the Stata menus. For a bar chart, Click on “Graphics” Click on “Bar chart” When you do this, the “graph bar – Bar chart” window shown below opens up:
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved