How to Create Dummy Variables in SPSS (With Example)

A dummy variable is a type of variable that we create in regression analysis so that we can represent a categorical variable as a numerical variable that takes on one of two values: zero or one.

For example, suppose we have the following dataset and we would like to use age and marital status to predict income:

To use marital status as a predictor variable in a regression model, we must convert it into a dummy variable.

Since it is currently a categorical variable that can take on three different values (“Single”, “Married”, or “Divorced”), we need to create k-1 = 3-1 = 2 dummy variables.

To create this dummy variable, we can let “Single” be our baseline value since it occurs most often. Here’s how we would convert marital status into dummy variables:

This tutorial provides a step-by-step example of how to create dummy variables for this exact dataset in SPSS and then how to perform regression analysis using these dummy variables as predictors.

Step 1: Enter the Data

First, let’s enter the values for the dataset in SPSS:

Step 2: Create the Dummy Variables

Next, to create the dummy variables for the MarriageStatus variable, click the Transform tab, then click Create Dummy Variables:

In the new window that appears, drag the MarriageStatus variable to the Create Dummy Variables for panel.

Then type a name that you would like to use for the prefix of the dummy variables within the Root Names box:

Once you click OK, the dummy variables will automatically be created:

dummy variables in SPSS

Next, we can use these dummy variables in a regression model to predict income.

Step 3: Perform Linear Regression Using the Dummy Variables

To perform multiple linear regression, click the Analyze tab, then click Regression, then click Linear:

In the new window that appears, drag Income into the Dependent box and drag Age, Status_1 and Status_2 into the Independent variables box directly below it:

Note: When using dummy variables in a regression model, we use all of the dummy variables except one as predictor variables so that we avoid the dummy variable trap.

Once we click OK, the following regression output will be shown:

From the Coefficients table we can write the following fitted regression equation:

Income = 14,276.12 + 1,471.67*(Age) – 8,397.40*(Divorced) + 2,479.75*(Married)

We can use this equation to find the estimated income for an individual based on their age and marital status. For example, an individual who is 35 years old and married is estimated to have an income of $68,264:

Income = 14,276.12 + 1,471.67*(35) – 8,397.40*(0) + 2,479.75*(1) = $68,264

Here is how to interpret the regression coefficients from the table:

  • Constant: The constant represents the average income for a single individual who is zero years old. Since an individual can’t be zero years old, it doesn’t make sense to interpret the intercept by itself in this particular regression model.
  • Age: Each one year increase in age is associated with an average increase of $1,471.67 in income. Since the p-value (.004) is less than .05, age is a statistically significant predictor of income.
  • Divorced: A divorced individual, on average, earns $8,397.40 less than a single individual. Since the p-value (0.532) is not less than .05, this difference is not statistically significant.
  • Married: A married individual, on average, earns $2,479.75 more than a single individual. Since the p-value (0.800) is not less than .05, this difference is not statistically significant.

Since both dummy variables were not statistically significant, we may decide to drop marital status as a predictor from the model because it doesn’t appear to add any predictive value for income.

Additional Resources

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

How to Perform Simple Linear Regression in SPSS
How to Perform Multiple Linear Regression in SPSS
How to Perform Logistic Regression in SPSS

Leave a Reply

Your email address will not be published. Required fields are marked *