How do I create a scatterplot with a regression line in SPSS?

Creating a scatterplot with a regression line in SPSS involves using the Graphs menu to select the scatterplot option and then choosing the appropriate variables to be plotted. Once the scatterplot is displayed, a regression line can be added by selecting “Add Fit Line at Total” from the “Elements” tab. This will generate a line of best fit for the data points and provide information on the strength and direction of the relationship between the variables. Further customization and analysis can be done using the various options and tools available in SPSS.

SPSS: Create a Scatterplot with Regression Line


Often you may want to create a scatterplot with a regression line in SPSS, such as the following:

SPSS scatterplot with regression line

Fortunately this is easy to do and the following step-by-step example shows how to do so.

Step 1: Enter the Data

First, let’s enter the following dataset into SPSS that contains information about total ad spend and total sales for 12 different retail stores:

We will create a scatterplot that displays ad spend on the x-axis and sales on the y-axis.

We will then add a regression line to the plot that uses ad spend as the predictor variable and sales as the response variable in the model.

Step 2: Insert a Scatterplot

To insert a scatterplot, click the Graphs tab, then click Chart Builder.

In the new window that appears, do the following:

  • Choose Scatter/Dot from the list of charts.
  • Drag the first scatter plot icon into the Chart Builder area.
  • Drag the Ad_Spend variable to the x-axis of the plot.
  • Drag the Sales variable to the y-axis of the plot.
  • Check the box next to Total under Linear Fit Lines

Then click the Y-Axis1 under Edit Properties of, then type 0 as the Minimum value for the Y-axis:

Once you click OK, the following scatterplot will be generated:

The R2 value of the regression line is also shown in the top right corner outside of the plot.

Related:

Step 3: Add Regression Line Equation

To add the regression line equation to the plot, double click anywhere on the plot to bring up the Chart Editor.

The double click on the regression line in the chart.

In the new window that appears, click the Fit Line tab and then check the box next to Attach label to line:

Once you click Apply, the regression line equation will be added to the regression line:

SPSS scatterplot with regression line

We can see that the fitted regression line equation is:

Sales = 29.63 + 0.76(Ad Spend)

Here is how to interpret the of the regression equation:

  • When ad spend is zero, expected sales is 29.63.
  • For each additional dollar in ad spend, sales increases by an average of 0.76.

Additional Resources

The following tutorials explain how to perform other common operations in SPSS:

x