Joseph Nathan Cohen

Department of Sociology, CUNY Queens College, New York, NY

Creating Quick Histograms in Stata

To see more about the “Teaching through YouTube” series.  For more, see this post.

Original Video Description

How to create quick histograms in Stata.

Transcription (Auto-Generated)

in this video i’ll show you how to make quick histograms in stata histograms can be used to describe the distribution of a variable this is an example of a histogram it describes the distribution of internet usage in a sample of countries the histogram shows that low internet usage countries are very prevalent over 30 percent of the sample has little to no internet users it shows that high internet usage is less common if you compare the bars on the right with the left you’ll see that a very small proportion of the sample has 60 or more internet users per 100 people to create quick histograms we use the command hist short for histogram the syntax for creating a histogram is hist space the name of the variable comma and then your options in this example i’m using net users which is a variable that describes the distribution of internet usage the percent option tells data to create a histogram with particular features there are many different options Command: Options available in creating quick histograms in stata we use the option discrete if we’re using discrete instead of continuous variables frac freak and percent tells data which y-axis scale to use frac expresses the y axis as decimal functions freak describes it as frequencies and percent gives it as a percent of the sample let’s see what it’s like to produce a quick histogram and a real status session his sei will give me a histogram of the variable sei which is the samples socioeconomic index that’s how the variable is distributed for discrete variables like degree use the option discrete it makes the bars fatter let’s review Review histograms can be used to describe the distribution of a variable the syntax for creating histograms is hist space the name of the variable comma and then the options you want to use for more information type help hist in the state of command window you