PSPP Graphics for Plotting Data: Examples and Notes
PSPP seems to have a limited list of built‑in graphs if you look only at the Graphs menu of the psppire GUI. However, PSPP can create a wider variety of charts, plots, and diagnostic graphics using PSPP syntax and several PSPP procedures. This page provides examples of histograms, scatterplots, residual plots, and other graphics commonly used in data exploration and regression analysis, along with additional plotting techniques available in PSPP.
Workflow Tip there is no one single menu within pspp or psppire where all graphs, plots, and charts, are located. They are spread across multiple procedures. Reading the manual is worthwhile in this case.
How to Make a Scatterplot of predicted vs residuals.
Here is an example of plotting residuals and predicted values from a linear regression. Residuals should be more or less randomly distributed. There should not be patterns in residuals. That's what you are looking for.
Scatterplots can be found in the PSPPIRE Data Editor menu Graphs-> Scatterplot and the psppire Scatterplot options window.
![]()
Data:
Data List ╭─────┬────┬────┬────┬─────╮ │ y │ x1 │ x2 │RES1│PRED1│ ├─────┼────┼────┼────┼─────┤ │10.00│1.00│4.10│-.20│10.20│ │12.00│2.00│5.00│ .20│11.80│ │13.00│3.00│6.20│-.07│13.07│ │15.00│4.00│7.10│ .33│14.67│ │16.00│5.00│8.00│-.27│16.27│ ╰─────┴────┴────┴────┴─────╯Code:
** Use regression output variables (pred and resid) to check data. GRAPH /SCATTERPLOT = pred1 WITH res1.Output:
![]()
All we see is a cloud of points and there is no trend or pattern. This is what we'd like to see from residuals: a random scatter with no pattern. With only 5 points, the plot is naturally sparse, but it still shows no systematic pattern (but note it's easy to be fooled by a few points).
Note: psppire outputs the entire output window, not individual plots. One way to save a plot for documentation or reports, is to use your system’s screenshot tool to capture just the graphic from the Output window.
Note: PSPP accepts the SPSS BIVAR keyword in scatterplots for compatibility, but it has no effect on the plot. PSPP always produces a simple bivariate scatterplot.
See Also: PSPP Inferential and Modeling Procedures which has the Linear Regression that produced this plot data.
How to Make a Histogram with PSPP
PSPP produces other types of plots, including histograms and bar charts. The next example is the histogram using the
GRAPHprocedure. This will be produced with a normal curve superimposed on the histogram. While this feature is not given in the documentation as an option to theHISTOGRAMgraph subcommand, it nonetheless produces the desired result. This uses the Auto-MPG dataset.Code
GET FILE="regression2.sav". GRAPH /HISTOGRAM (NORMAL) = mpg.Output
Statistics +---------+---------+ | |cylinders| +---------+---------+ |N Valid | 392| | Missing| 0| +---------+---------+ |Mean | 5.47| +---------+---------+ |Std Dev | 1.71| +---------+---------+ |Minimum | 3| +---------+---------+ |Maximum | 8| +---------+---------+ cylinders +-------+---------+-------+-------------+------------------+ | |Frequency|Percent|Valid Percent|Cumulative Percent| +-------+---------+-------+-------------+------------------+ |Valid 3| 4| 1.0%| 1.0%| 1.0%| | 4| 199| 50.8%| 50.8%| 51.8%| | 5| 3| .8%| .8%| 52.6%| | 6| 83| 21.2%| 21.2%| 73.7%| | 8| 103| 26.3%| 26.3%| 100.0%| +-------+---------+-------+-------------+------------------+ |Total | 392| 100.0%| | | +-------+---------+-------+-------------+------------------+ See piechart-1.png for a chart.![]()
To produce the plot without the normal curve, remove the "
(NORMAL)" from theGRAPHcommand.The PSPP GUI (psppire) can do histograms. There is a checkbox for the normal curve on the Histogram input screen. See Graphs->Histogram and the psppire Analyze->Descriptive Statistics->Frequencies->Charts options menu.
![]()
How to Make a Bar Chart with PSPP
Here is an example of a bar chart of the number of cylinders in the engines of the cars from the auto-mpg dataset. You can see that 4-cylinder engines are the most popular. 3-cylinder engines are used by American automakers including Chevrolet, Buick, and Ford, as well as Nissan and Toyota even in 2026. 5-cylinder engines are also still used by some manufacturers such as Acura, Audi, Ford, Toyota, Fiat, Chevrolet, and others. 6- and 8-cylinder cars follow 4-cylinder cars in popularity.
Code
GRAPH /BAR = COUNT by cylinders.Output
![]()
In psppire, the barchart settings can be found in the Graphs->Histogram and the psppire Analyze->Descriptive Statistics->Frequencies->Charts options menu.
![]()
Creating a Pie Chart with PSPP's FREQUENCIES Procedure
This example will use the auto-mpg data set again. For the pie chart the cylinders variable will be plotted. Cylinders are limited, so make a good choice for a pie chart. If there had been many values, the pie chart would get very crowded with small wedges and not be very useful.
In psppire, the Piechart can be found at Analyze->Descriptive Statistics->Frequencies->Charts on the Charts menu
.
Code
GET FILE="regression2.sav". DISPLAY DICTIONARY. FREQUENCIES VARIABLES = cylinders /PIECHART.Statistics +---------+---------+ | |cylinders| +---------+---------+ |N Valid | 392| | Missing| 0| +---------+---------+ |Mean | 5.47| +---------+---------+ |Std Dev | 1.71| +---------+---------+ |Minimum | 3| +---------+---------+ |Maximum | 8| +---------+---------+ cylinders +-------+---------+-------+-------------+------------------+ | |Frequency|Percent|Valid Percent|Cumulative Percent| +-------+---------+-------+-------------+------------------+ |Valid 3| 4| 1.0%| 1.0%| 1.0%| | 4| 199| 50.8%| 50.8%| 51.8%| | 5| 3| .8%| .8%| 52.6%| | 6| 83| 21.2%| 21.2%| 73.7%| | 8| 103| 26.3%| 26.3%| 100.0%| +-------+---------+-------+-------------+------------------+ |Total | 392| 100.0%| | | +-------+---------+-------+-------------+------------------+See piechart-1.png for a chart.Output
![]()
4-cylinder cars outnumber 6- and 8-cylinder cars in this dataset. This is plain from looking at the pie chart.
Creating a Boxplot with PSPP's EXAMINE Procedure
This example will again use the auto-mpg data. The box plot will be done for the mpg variable, which is the dependent variable in the regression we did earlier with the auto-mpg data.
PSPP's EXAMINE command supports boxplot, histograms, and normality plots. Stem-and-leaf displays are not currently implements in pspp.
In psppire, the Boxplots can be found at Analyze->Descriptive Statistics->Explore->Plot Button on the Analyze menu.
The resulting boxplot depends on the variables assigned in the Explore dialog:
- With only a dependent variable selected, PSPP produces a single boxplot.
- With a dependent variable and a factor variable selected, PSPP produces a boxplot that displays the dependent variable for each category of the factor variable.
PSPPIRE Menu for Examine/Explore Single variable
![]()
PSPPIRE Menu for Examine/Explore 2 variables
![]()
Code
GET FILE="regression2.sav". DISPLAY DICTIONARY. EXAMINE VARIABLES = mpg /PLOT BOXPLOT. EXAMINE VARIABLES = mpg by cylinders /PLOT BOXPLOT.Output
Case Processing Summary +---+---------------------------------+ | | Cases | | +-----------+---------+-----------+ | | Valid | Missing | Total | | +---+-------+-+-------+---+-------+ | | N |Percent|N|Percent| N |Percent| +---+---+-------+-+-------+---+-------+ |mpg|392| 100.0%|0| .0%|392| 100.0%| +---+---+-------+-+-------+---+-------+ See boxplot-1.png for a chart. Tests of Normality +---+-----------------------+ | | Shapiro-Wilk | | +---------+---+---------+ | |Statistic| df| Sig. | +---+---------+---+---------+ |mpg| .97|392|1.05E-007| +---+---------+---+---------+ Case Processing Summary +-------------+---------------------------------+ | | Cases | | +-----------+---------+-----------+ | | Valid | Missing | Total | | +---+-------+-+-------+---+-------+ | cylinders| N |Percent|N|Percent| N |Percent| +-------------+---+-------+-+-------+---+-------+ |mpg 3 | 4| 100.0%|0| .0%| 4| 100.0%| | 4 |199| 100.0%|0| .0%|199| 100.0%| | 5 | 3| 100.0%|0| .0%| 3| 100.0%| | 6 | 83| 100.0%|0| .0%| 83| 100.0%| | 8 |103| 100.0%|0| .0%|103| 100.0%| +-------------+---+-------+-+-------+---+-------+ See boxplot-2.png for a chart. Tests of Normality +-------------+-----------------------+ | | Shapiro-Wilk | | +---------+---+---------+ | cylinders|Statistic| df| Sig. | +-------------+---------+---+---------+ |mpg 3 | 1.4E+012| 4| NaN| | 4 | .98|199| .00| | 5 | .92| 3| .44| | 6 | .82| 83|1.37E-008| | 8 | .92|103|1.90E-005| +-------------+---------+---+---------+Boxplot of MPG
![]()
Boxplot of MPG by Cylinders
![]()
The boxplot of mpg shows that the mpg variable has no outliers, since PSPP marks outliers with circles and none appear. The median line is near the center of the box, indicating that the middle 50% of the data is fairly symmetric. The whiskers extend to the minimum and maximum values without being excessively long, suggesting a moderate spread. The Shapiro–Wilk test confirms that mpg is not normally distributed, which is typical for real‑world fuel economy data.
However, the cylinders data does have outliers.
Boxplot of Horsepower
![]()
The horsepower boxplot shows how pspp plots outliers in a variable. This variable has many outliers that should be investigated. The data are highly skewed. Perhaps a transformation is needed. Or maybe the data need correction (e.g. data entry error). These are decisions for the data analyst.
Workflow Tip: This boxplot is doing what it was designed to do: showing the odd or extreme values in the variable. It does not mean these values should be dropped from the boxplot or otherwise covered up in the presentation. They should be investigated and explained.
Can PSPP create a Stem and Leaf plot? A review of the PSPP User Manual does not show any stem and leaf plot in any procedure. The Not Implemented list in the manual explicity states that the
STEMLEAFcommand – used to plot a stem and leaf display – is not implemented.Using PSPP's EXAMINE Command for Normality Diagnostic Plots
PSPP's
EXAMINEcommand has a /PLOT subcommand that can generate several diagnostic graphs, including a Normal Q-Q plot and a spread-level plot which PSPP labels as a detrended normal Q-Q plot by pspp. It also includes Shapiro-Wilk statistic output, which is commonly used to test normality.In psppire, the Residual Plots can be found at Analyze->Descriptive Statistics->Explore->Plot Button on the Analyze menu.
This example will use the Auto-MPG data with n=392 to provide enough observations for clear disagnostic plots.
PSPPIRE Menu for Examine/Explore Residual Plots
![]()
Code
GET FILE="regression2.sav". LIST. EXAMINE /VARIABLES=res1 /PLOT NPPLOT /PLOT SPREADLEVEL.Note: because I wanted to save the plots for use in this page, I ran this example from a unix command line using command line pspp. psppire will also work, but getting the graphics out is a few more steps. EXAMINE gives a case summary first. This program is reading the residuals (RES1) from the regression model. n=392 is correct and there are no missing values, which is expected.
Output
Case Processing Summary +----+---------------------------------+ | | Cases | | +-----------+---------+-----------+ | | Valid | Missing | Total | | +---+-------+-+-------+---+-------+ | | N |Percent|N|Percent| N |Percent| +----+---+-------+-+-------+---+-------+ |RES1|392| 100.0%|0| .0%|392| 100.0%| +----+---+-------+-+-------+---+-------+The two plots produced are noted next. They are the Q-Q plot and the detrended Q-Q plot.
Q-Q plot of the residuals.
pspp calls the Q-Q plot the npplot type in EXAMINE.
De-trended Q-Q plot of the residuals.
The de-trended Q-Q plot is often more informative than the standard Q-Q plot because it displays deviations from normality directly, without the diagonal reference line that can visually mask systematic departures. pspp calls this the spreadlevel plot in EXAMINE.
The de-trended Q-Q plot above shows an issue with normality. The data are obviously skewed. Whether this is enough to bias your model is a judgment you'll need to make, and that judgment gets easier as you get more experience with data.
If your dependent variable is strongly skewed, your instructor or boss may recommend a transformation (for example, a log or Box–Cox). PSPP can compute transformed variables using
COMPUTEbefore running the analysis.Finally, the Shapiro-Wilk test of normality result is given. In this case, the test statistic is .97 and p-value is 1.72E-006, which is tiny and much less than .05. Therefore we rejected the null hypothesis that the residuals are normally-distributed. Statistically this indicates non-normality.
Tests of Normality +----+-----------------------+ | | Shapiro-Wilk | | +---------+---+---------+ | |Statistic| df| Sig. | +----+---------+---+---------+ |RES1| .97|392|1.72E-006| +----+---------+---+---------+
[PSPP Syntax] [PSPP Analysis-Exploratory] [PSPP Analysis-Inferential & Modeling] [PSPP Combining & Merging] [PSPP Multi-Record] [PSPP Utils] [[PSPP Charts & Graphics]]If you have suggestions, comments, or corrections, you can open an issue on the Github repository Issues list

