Title: Dummies
Course: UGQuants (SSPS) > Section: Multiple Regression

Dummies

Linear regression is used with interval or ratio level data.  Using nominal or ordinal data would violate the assumptions of the model.  However, in multiple regression we can include independent variables at these levels of measurement, although it is usually much better to have one or more at the interval or ratio level too.   If our variable can only take one of two possible values (e.g. sex), it is known as a dichotomous variable.  We need only recode these values as 0 and 1 for male and female (or the other way round, if you prefer).  If our variable takes more than two discrete (whole number) values, then we have to transform it into a series of more than one dummy variable, each dummy expressing a dichotomy between one of the values of the original variable and all others.  The number of dummy variables that we need to create is one less than the original number of values that our nominal or ordinal variable takes.

For example, the nominal variable for region in the WDI dataset takes five values as follows:

1 | South & East Asia, Pacific
2 | Latin America & Caribbean
3 | Sub-Saharan Africa
4 | Europe & Central Asia, North America
5 | Middle East & North Africa

To express this variable as a set of dummies we could recode it as follows (other formulations are possible):

Reg1    0 = all other regions             1= South & East Asia, Pacific
Reg2    0 = all other regions             1 = Latin America & Caribbean
Reg3    0 = all other regions             1 = Europe & Central Asia, North America

Reg4    0 = all other regions             1 = Sub-Saharan Africa

We do not need a separate dummy for Middle East & North Africa, as the effect of Middle East & North Africa can be taken as a base category against which to measure the other dummies; i.e. for cases in Middle East & North Africa, Reg1, Reg2 and Reg3, and Reg 4 will all be equal to 0.  The following table clarifies this:

Value of Cont | Reg1 | Reg2 | Reg3 | Reg4
1. South & East Asia, Pacific | 1 | 0 | 0 | 0
2. Latin American & Caribbean | 0 | 1 | 0 | 0
3. Sub-Saharan Africa | 0 | 0 | 1 | 0
4. Europe & Central Asia, North America | 0 | 0 | 0 | 1
5. Middle East & North Africa | 0 | 0 | 0 | 0

In simple multiple regression, dummies can be treated just like any other variable.  Although there are some complexities that can arise from their use, these are beyond the scope of this course.  The main thing to remember is that they must be kept together if they are to be entered in a block.

Let us explore whether, having taken GDP and HIV into account, the fact of being a state in Sub-Saharan Africa still seems to be correlated with lower female life expectancy.  Since we are only interested in the specific continent of Sub-Saharan Africa we do not need to enter all the dummies in our regression model.  Entering Reg4 will be enough to allow us to compare the 48 countries in Africa with all other countries.  To do this we enter lngdp and lnHIV as before, but now we can enter Reg4 as a variable in a subsequent block in the model.

Our output looks like this:

We can see that there is a negative effect associated with being a state in Africa, but it actually adds only about 4.4% to the explanatory power of our model.  It seems to be that once we control for GDP and HIV, the distinct effect of being in an African state is small.  Low female life expectancy seems to be overwhelmingly an outcome of low GDP and the prevalence of HIV.

Note: making dummy variables for a regression
While you can use the compute command in SPSS to create the dummies, it can actually be quicker and easier to use command syntax in SPSS to do this.  As shown in the animation, this involves creating a syntax file in SPSS to issue simple commands.  For our example above, we would first tell SPSS to make a new variable called Reg1 and set its value to 0 for every case and then tell it to change this value to 1 for those cases that are countries in Africa; for those cases where the variable Reg is equal to 1.

The syntax to create such a variable, and the other two dummies needed to cover all the values in cont would be:

compute Reg1 eq 0.
if (Region2 eq 1) Reg1 eq 1.
compute Reg2 eq 0.
if (Region2 eq 2) Reg2 eq 1.
compute Reg3 eq 0.
if (Region2 eq 3) Reg3 eq 1.

compute Reg4 eq 0.
if (Region2 eq 4) Reg4 eq 1.

freq Region2 Reg1 to Reg4.

Note how each command ends in a full stop and that we ask for a frequency table at the end to check that everything has worked out as we planned.