### Math 221 – Principles of Statistics

Creating Bar Graphs for Stacked Data in SPSS

______________________________________________________________

If your data are stacked and you want a separate bar graph for each sample, you must tell this to SPSS. Otherwise SPSS will lump all your samples together and make a single bar graph. If you prefer to use a clustered bar graph, click here.

1) Open a data file (in .sav or .por format) or type your data in.

2) In either the Data Editor window or the Output Viewer window, click on the “Graphs" menu and then on "Bar..."

3) Select "Simple" and click "Define."

4) If you would like the heights of the bars to represent counts, make sure "N of cases" is selected. If you would like the heights of the bars to represent percents, click the radio button next to "Percent."

5) Select the variable you would like to plot. Click on the little arrow next to "Category Axis." This will move the variable into the "Category Axis" box.

6) Select the grouping variable. Click on the little arrow next to "Rows:" under "Panel by." This will move the grouping variable into the "Rows" box and force SPSS to create a separate bar graph for each value of the grouping variable.

7) If you would like to add a title to your plot, click the "Titles..." button. A new dialog box appears. Enter any titles or subtitles you want to use, and click "Continue..."

8) Click "OK."  The bar graph appears in the Output Viewer. Notice that the vertical axis is labeled "Percent" if you selected "Percent" in Step 5, and that it is labeled "Count" if you selected "N of cases." By default, each different value of the variable that occurs in your data is given its own bar. NOTE: For quantitative data, this often results in too many bars. If your data are quantitative, consider using a histogram instead of a bar graph.

#### ______________________________________________________________

##### David E. Brown

232 Ricks Building                         208-496-1839 voice

Rexburg, ID 83440                              208-496-2005 fax

Please do not call me at home.