Histograms

Histograms are useful for showing the distribution of a single scale variable. Data are binned and summarized using a count or percentage statistic. A variation of a histogram is a frequency polygon, which is like a typical histogram except that the area graphic element is used instead of the bar graphic element.

Another variation of the histogram is the population pyramid. Its name is derived from its most common use: summarizing population data. When used with population data, it is split by gender to provide two back-to-back, horizontal histograms of age data. In countries with a young population, the shape of the resulting graph resembles a pyramid.

How to create a histogram

  1. In the Chart Builder, click the Gallery tab and select Histogram in the Choose From list.
  2. Drag the Simple Histogram icon onto the canvas.
  3. Drag a scale variable to the x-axis drop zone.

Note: The statistic for a histogram is Histogram or Histogram Percent. These statistics bin the data and calculate a count for each bin. If you change the statistic, the chart will no longer be a histogram.

How to create a population pyramid

  1. In the Chart Builder, click the Gallery tab and select Histogram in the Choose From list.
  2. Drag the Population Pyramid icon onto the canvas.
  3. Drag a variable to the Distribution Variable drop zone. The measurement level of the variable is typically scale, in which case the scale values are binned and counts are calculated for each bin. However, you can use a categorical variable, in which case counts are calculated for each category. If the data are already preaggregated with a variable that contains the counts, be sure to weight the data by the count variable before creating the chart.
  4. Drag a categorical variable to the Split Variable drop zone. Although it is possible to use a split variable with many categories, it is recommend to use a variable like gender that has only two categories. The split variable acts as a paneling variable in that it creates multiple graphs.

Additional features

Stacking. Stacking adds dimensionality within the chart. Stacking creates segments in each bar. For more information about specifying stacking, see Adding and editing grouping variables . The gallery also provides an option for a stacked histogram.

Paneling. Paneling creates a table of charts, with a cell for each category in the paneling variable. See the topic Adding Paneling Variables for more information.