Skip to Main Content

SPSS

Charts and Graphs in SPSS

Making charts and graphs in SPSS is easy! 

Charts and graphs are effective ways to represent data to an audience. 

Select Desired Graph

A pie chart is best for showing the proportions of occurrence of the options in a nominal level variable. 

SYNTAX

GRAPH
  /PIE=COUNT BY language.

 

We use the command GRAPH to tell SPSS we want to produce a /PIE chart by the COUNT of observations in the variable language.  

OUTPUT

The pie chart shows us that the overwhelming majority of observations reported speaking English, the next largest group is other languages, and the smallest French. This a quick and effective way to share the frequency or percent of the observations with others. Often times publications do not accept color charts, so using patterns instead are also effective.

Histograms are best to plot continuous level variables because, as the name suggests, the values are on a continuum. Histograms are very helpful for investigating the distribution of continuous variables which is important for determining if a variable needs to be recoded.

SYNTAX

GRAPH

  /HISTOGRAM=age.

 

We use the command GRAPH and specify with the /HISTOGRAM subcommand to plot the graph of the continuous variable age. 

OUTPUT

The histogram shows us the range of ages among the observations and the frequency of occurrence. We can also see that the distribution of age does not follow a normal curve and is skewed to the right. This may effect our results of our earlier statistical tests.   

Boxplots, often called box-and-whisker plots and are used to represent the quartiles of continuous level variables. Boxplots display the variation in the sample with boxes that represent the quartiles and 'whiskers' of observations outside the upper and lower quartiles. These plots can be done with a single variable or multiple variables, as we will see below.

SYNTAX

EXAMINE VARIABLES=age
  /PLOT=BOXPLOT.​

 

We EXAMINE the VARIABLE age by specifying the /PLOT as a BOXPLOT.

OUTPUT

undefined

 

 

When plotting a box plot, SPSS gives us a charts with a host of descriptive statistics that are and are not represented in the chart. This is useful to interpret the box plot. 

The box plot below shows us the median of the variable "age" with a horizontal line inside the blue box. The top and bottom of the blue box are the 25 (Q1) and 75 (Q3) quartiles of the distribution. Next, the whiskers are the minimum and maximum values recorded ages of the observations. 

SYNTAX

EXAMINE VARIABLES=age BY sex

  /PLOT=BOXPLOT.

 

We EXAMINE the VARIABLES age BY sex with the /PLOT as a BOXPLOT.

OUTPUT

This box plot is separated by the sex of the observations (Female and Male). This helps us to see the distribution of age by sex. 

Bar charts are bested used to represent ordinal level variables to show the distribution of the options. We can made a bar chart of a single variable or multiple variables for a direct comparison.

SYNTAX

GRAPH

  /BAR(SIMPLE)=COUNT BY sex.

 

We use the GRAPH command and specify we want a /BAR graph that is (SIMPLE) format where the COUNT is of the variable sex.  

OUTPUT

 

 

 

The bar chart above shows the raw count of observations of the variable "sex" broken up by the observations. We can see clearly that there are more females than males in the dataset, but this difference is not great. Using the results from this bar chart we could ask ourselves "is there a statistically significant difference between females and males across language, education, or wages?".

SYNTAX

GRAPH

  /BAR(STACK)=COUNT BY sex BY language.

 

We use the GRAPH command and specify we want a /BAR graph that is in (STACK) format where the COUNT the variable sex BY language.  

OUTPUT

 

 

 

This is called a stacked bar chart, where we have broken the observations by sex (female and male) and within each sex 'stacked' the observations by language. We can see that within each sex the options for language are stacked on top of each other and denoted with colors to show the distributions. This is helpful to convey in one chart the distributions of multiple variables.  

Scatter plots are best used to show graphically if there is a relationship between two variables and what that relationship looks like. 

SYNTAX

GRAPH

  /SCATTERPLOT(BIVAR)=education WITH wages

  /MISSING=LISTWISE.

OUTPUT

undefined

 

 

Above is a scatter plot of the variable education by wages. That is, the points in this graph are the values of education relative to wages. Scatter plots are very helpful when examining continuous level variables and if a graphical relationship exists. We can see in this scatter plot that there is some clustering of observations when educations is 15 and wages is 10. This may suggest there is some relationship that exists. After looking as this graph, we would next want to conduct statistical tests to see if the relationships is statically significant.