How to create a histogram in SPSS

From WikiEducator
Jump to: navigation, search

These instructions are based on the student version of PASW (SPSS) version 18.

You can design a histogram using the available options. The histogram will be created in the Output window, after you click "OK".

  • Before beginning the process to create the histogram, be sure to have defined the variable to be graphed using the Data > Define Variable Properties dialog box.

Now you are ready to design the histrogram.

  • Select Graphs > Chart Builder.
  • If you have defined the variable to be graphed, click OK in the Chart Builder warning dialog, if it displays.

The Histogram dialog box displays.

  • In the Gallery area at the bottom of the box, select Histogram from the listing.
  • Select the picture of the simple histogram and drag it to the large chart preview window.

A crude preview will display and the Element Properties window will open.

  • In the Chart Builder dialog, click and drag the variable to be graphed (from the list on the left) to the X-Axis? area in the preview window.

Don't worry that the preview graph fails to represent your data. The preview is based on example data.

In the Element Properties dialog (if not already open, click Element Properties... on the right hand side of the Chart Builder dialog), assign the properties to each of the chart elements:

  1. Select Bar1.
    • For the Statistic to be used, choose Histogram.
    Note that interval size for the bars can be controlled using the Set Parameters dialog; by default SPSS auto-creates the intervals.
    • Select Display Normal Curve to overlay a normal curve on the histogram.
    • Choose the Bar Style to be used, usually Bar.
    • Click Apply at the bottom of the box.
  2. Select X-Axis1 (Bar1).
    • Enter a label for the x-axis in the Axis Label field.
    • Confirm that the Sort by and Direct properties are adequate for your variable, revise if necessary.
    • Click Apply at the bottom of the box.
  3. Select Y-Axis1 (Bar1).
    • Confirm that the label, scale range and scale type properties are adequate for your variable, revise if necessary.
    • Click Apply at the bottom of the box.

To display titles, subtitles, or footnotes on the histogram

  • Select the Titles/Footnotes tab in the lower area. (Arrow to the right on the task bar which begins with Gallery.)
  • Select Title 1.

The Element Properties dialog opens, with the new element Title displayed in the list.

  • Enter a title for the graph in the Content field.
  • Click Apply at the bottom of the box.
  • Add other titles/footnotes as desired.

A basic histogram is now ready to be created. Note that the preview window may not adequately display the titles and such that you have specified. Not to worry. The histogram that will appear in the output window will have the specified elements, as long as you have applied the specifications in the Element Properties dialog. To create separate histograms by group, see the instructions in the section below, otherwise...

  • Click OK.

The Chart Builder dialog box closes and SPSS activates the Output window to display the histogram.

To make adjustments to the resulting histogram, double-click the histogram displayed in the output window. The Chart Editor displays. Revise the properties of the histogram using the available tools. For example, you can revise the interval size of the bars via Options > Bin Element. In the Properties dialog, select Custom and then enter the Number of intervals or the Interval width.

How to create separate histograms by group

To create separate histograms by group add the following steps to the basics described above:

  • select the Groups/Point ID tab in the lower window of the Chart Builder dialog.
  • Check one of the "panel" options, depending on how you want the resulting histograms to display (the best way to see how each option works is to try them out).
  • Drag the grouping variable to the new Panel? area in the preview window.
  • Select the new "panel" element in the Element Properties dialog; revise the options as desired.