• Laura Whiting

Stata Bar Graph with Counts Labelled on the Bars

We have written a small program that will allow you to generate a bar graph of means for one variable against categories in another variable. Each bar category on the X axis is labelled with the number of observations that fit into that category.


To create this graph in Stata, you first need to install or recreate our program. One way of doing this is to download the text file below, and then save it as "barlabels.ado" in your personal ado directory. The other option is to copy the program code into a new do-file in your Stata and run that do file to load the program into Stata.

barlabels
.txt
Download TXT • 632B




The program code is also shown below:


To generate this graph in Stata, once you have the appropriate barlabels command loaded, use the following commands:


3 views0 comments

Recent Posts

See All

© 2020 by Survey Design and Analysis Services. 

  • LinkedIn
  • Facebook
  • Twitter
  • YouTube