By Ruben Geert van den Berg on February 22, 2017 under SPSS Data Preparation Tutorial.

Creating Histograms in SPSS

SPSS Histogram Styled Salary Bank

Among the very best SPSS practices is running histograms over your metric variables. Doing so is a super fast way to detect problems such as extreme values and gain a lot of insight into your data. This tutorial quickly walks you through using bank_clean.sav, part of which is shown below.

SPSS Data View Bank Clean

Option 1: FREQUENCIES without Frequency Tables

If you're running a data inspection without any need for pretty charts, then the easiest option is running the FREQUENCIES command shown below.

*Fastest option for creating histograms.

frequencies salary
/format notable

*/format notable suppresses (huge) frequency tables.


SPSS Histogram Unstyled Bank

Multiple Histograms in One Go

Running histograms like this does not allow you to use custom titles for your charts. However, it does allow running many histograms in one go as shown below. Oddly, doing so results in variable labels being used as chart titles instead of “Histogram” in our first example.

*Run several histograms with single command.

frequencies whours to overall
/format notable

Option 2: GRAPH

If you'd like to include one or more histograms in your report, you probably need somewhat prettier charts. Creating a GRAPH command from the menu -as shown below- allows us to set nice custom titles and makes it easier to style our charts with an SPSS chart template.

SPSS Histogram Menu 720

SPSS Legacy dialogs for charts contain way more charts than most users are aware of and generate much nicer, cleaner syntax than the Chart Builder.

SPSS Histogram Dialog

We'll choose “All Respondents | n = 464” as our main title here because this is relevant but far from obvious.

Resulting Syntax

*Histogram with title as pasted from Graph - Legacy Dialogs.

/TITLE='All Respondents | n = 464'.

The result still looks pretty much the same. We'll fix that next.

Styling our Histogram

Last but not least, we'll style our histogram. If we save our styling as a chart template, we can easily apply it to all subsequent histograms, which may save us a lot of time. Like so, our final syntax example uses “histogram-nosum-title-720-1.sgt”. (“.sgt” is short for “SPSS Graph Template” but the file is referred to as a chart template.)
If this file is absent, SPSS will throw a warning and still run our histogram with whatever default template -if any- has been set.

SPSS Histogram Syntax with Template

*Histogram with title and chart template applied. Creates unstyled chart if template file absent.

/TITLE='All Respondents | n = 464'
/template 'histogram-nosum-title-720-1.sgt'.

Final Result

SPSS Histogram Styled Salary Bank

So that's basically it. We could discuss some more options but we don't find them useful in practice, so we'd rather keep it short this time.
We hope you found this tutorial helpful. Thanks for reading!

Related Tutorials

Histogram – What Is It?

A histogram is a chart showing frequencies for fixed width intervals of a metric variable. This tutorial explains what histograms are and demonstrates why they are useful with illustrations and examples. Read more

SPSS Data Preparation 5 – Inspect Variables

Scanning your variables for unusual distributions is easy and facilitates later steps in the analysis of your data. This tutorial shows how to do so quickly. Read more

Comment on this Tutorial

*Required field. Your comment will show up after approval from a moderator.