Spss 23 P 3
Spss 23 P 3
Table of Contents
Introduction ......................................................................................................................................2
Downloading the Data Files.................................................................................................................... 2
Simple Regression ..............................................................................................................................2
Scatter Plot ............................................................................................................................................. 2
Predicting Values of Dependent Variables ............................................................................................. 5
Predicting This Year’s Sales with the Simple Regression Model ............................................................ 6
Multiple Regression ...........................................................................................................................8
Predicting Values of Dependent Variables ............................................................................................. 9
Predicting This Year’s Sales with the Multiple Regression Model........................................................ 10
Data Transformation ........................................................................................................................ 11
Computing ............................................................................................................................................ 12
Polynomial Regression ..................................................................................................................... 13
Regression Analysis .............................................................................................................................. 14
Analyzing the Results ..................................................................................................................... 14
Chart Editing .................................................................................................................................... 15
Adding a Line to the Scatter Plot .......................................................................................................... 15
Manipulating the Scales on the X and Y Axes....................................................................................... 17
Adding a Title to the Chart ................................................................................................................... 19
Adding Color to the Chart..................................................................................................................... 19
Applying a Background Color ............................................................................................................... 20
This handout provides basic instructions on how to answer research questions and test hypotheses
using linear regression (a technique which examines the relationship between a dependent variable and
a set of independent variables). The value of the dependent variable (e.g., salesperson’s total annual
sales) can be predicted based on its relationship to the independent variables used in the analysis (e.g.,
age, education, and years of experience). The two research questions proposed in this handout are as
follows:
• How much money will each salesperson make this year?
• Who will qualify for a $1,000 bonus?
Simple Regression
Simple regression estimates how the value of one dependent variable (Y) can be predicted based on
the value of one independent variable (X). The linear equation for simple regression is as follows:
Y = aX + b
Scatter Plot
A scatter plot displays the nature of the relationship between two variables. Before performing a
regression analysis, it is recommended to run a scatter plot to determine if there is a linear relationship
between the variables. If there is no linear relationship (i.e., points on a graph are not clustered in a
straight line), then a simple regression would not be the appropriate analysis to use for this data set.
3. In the Scatter/Dot dialog box, make sure that the Simple Scatter option is selected, and then
click the Define button (see Figure 2).
NOTE: The Simple Scatter plot is used to estimate the relationship between two variables.
4. In the Simple Scatterplot dialog box, select the Last year sales variable in the left box, and then
click the transfer arrow button to move it to the Y Axis box (see Figure 3).
5. Select the Years of experience variable in the left box, and then click the transfer arrow button
to move it to the X Axis box.
6. Click the OK button. The Output Viewer window opens and displays a scatter plot of the
variables (see Figure 4).
NOTE: The scatter plot in Figure 4 indicates that a linear relationship exists between the
variables Last year sales and Years of experience. The next step is to find a line that best
accommodates the pattern of points in this scatter plot. The steps for enhancing the graph
appearance are covered in the last section of this handout.
The following tables in the Output Viewer window present the results of a simple regression. R Square
(.918) indicates that this model accounts for almost 92% of the total variation in the data (see Figure 6).
The slope and the y-intercept as seen in Figure 7 should be substituted in the following linear equation
to predict this year’s sales: Y = aX + b. In this case, the values of a, b, X, and Y will be as follows:
a = 1954.658
b = 440.987
X = Years of experience (values of independent variable)
Y = Last year sales (values of dependent variable)
5. Click the OK button. The results are displayed in the Simple column in Data View (see Figure 9).
4. Click the Data View tab in the lower-left corner of the Data Editor window.
NOTE: The prediction of this year’s sales for each salesperson is computed under the new
variable named Simple (see Figure 12).
Multiple Regression
Multiple regression estimates the coefficients of the linear equation when there is more than one
independent variable that best predicts the value of the dependent variable. For example, a
salesperson’s total annual sales (the dependent variable) can be predicted based on independent
variables such as age, education, and years of experience. The linear equation for multiple regression is
as follows:
Z = aX + bY + c
NOTE: The table should look similar to Figure 14. R Square = .976 indicates that this model can
predict this year’s sales almost 98% correctly.
To predict this year’s sales, substitute the values for the slopes and y-intercept displayed in the Output
Viewer window (see Figure 15) in the following linear equation: Z = aX+ bY + c.
As indicated in the output table, the coefficient for Years of experience is 1874.5 and the coefficient for
Years of education is 609.391.
6. Click the OK button. The Multiple column in Data View displays the results (see Figure 17).
NOTE: The sales prediction for each salesperson using two independent variables is listed under
the new variable named Multiple.
Data Transformation
Situations may arise when data transformation is useful. Most data transformations can be performed
with the Compute command. Using this command, the data file can be manipulated to fit various
statistical performances.
Research Question # 2
Who will earn a $1,000 bonus?
4. In the Compute Variable: If Cases dialog box, select the Include if case satisfies condition
option button (see Figure 19).
5. Enter the following expression by typing or selecting from the dialog box keypad:
thissale - multiple >= 2000
NOTE: It is recommended to select the variables and the >= sign directly from the Variable
box and keypad provided in the dialog box to prevent mistakes.
Polynomial Regression
This type of regression involves fitting a dependent variable (Yi) to a polynomial function of a single
independent variable (Xi). The regression model is as follows (see Table 1 for the meaning of the
variables):
Yi = a + b1Xi + b2Xi2 + b3Xi3 + … + bkXik + ei
Polynomial regression can find the line of best fit for polynomials consisting of two or more variables. If
X is the dependent variable, use the Transform and Compute options of the Data Editor (as discussed
earlier in this lesson) to create new variables X2 = X*X, X3 = X*X2, X4 = X*X3, etc., then use these new
variables (X, X2, X3, X4, etc.) as a set of independent variables for the regression analysis.
Chart Editing
During the final stage of research, enhancing the appearance of charts and figures can help viewers
understand what may seem to be confusing statistics. The following steps explain some useful methods
for enhancing a chart’s appearance.
Figure 26 – Scale Tab of the Properties Dialog Figure 27 – Labels & Ticks Tab of the Properties
Box (X Axis) Dialog Box (X Axis)
9. Click the Show Grid Lines button on the Standard toolbar. The Properties dialog box
displays the Grid Lines tab (see Figure 28).
10. Select the Major ticks only option button, click the Apply button, and then click the Close
button.
Figure 28 – Grid Lines Tab of the Properties Figure 29 – Scale Tab of the Properties Dialog
Dialog Box (X Axis) Box (Y Axis)
NOTE: Below is the chart before and after manipulating the X and Y axes (see Figure 30 and
Figure 31).
Figure 30 – Chart Before Manipulating the X Figure 31 – Chart After Manipulating the X and
and Y Axes Y Axes