Tuesday, March 14, 2017

logit, categorical independent variable, dummy variable, spss

All explanatory variables need to be placed in what is named the covariates box. If the explanatory variable is continuous it can be dropped in to this box as normal and SPSS can be trusted to add it to the model, However, the process is slightly more demanding for categorical variables such as the three we wish to add because we need to tell SPSS to set up dummy variables based on a specific baseline category (we do not need to create the dummies ourselves this time).

To do this we need to click the button marked ‘Categorical’ to open a submenu. You need to move all of the explanatory variables that are categorical from the left hand list (Covariates) to the right hand window.

The next step is to tell SPSS which category is the reference (or baseline) category for each variable. To do this we must click on each in turn and use the controls on the bottom right of the menu which are marked ‘Change Contrast’. The first thing to note is the little drop down menu which is set to ‘Indicator’ as a default. This allows you to alter how categories within variables are compared in a number of ways (that you may or may not be pleased to hear are beyond the scope of this module). For our purposes we can stick with the default of ‘indicator’, which essentially creates dummy variables for each category to compare against a specified reference category 

All we need to do then is tell SPSS whether the first or last category should be used as the reference category (code 0) and then click ‘Change’ to finalise the setting.

Whether you choose Last or First will depend on how you set up your data. In this example, males are to be compared to females, with females acting as the reference category (who were coded "0"). Therefore, First is chosen.

For our Ethnic variable the first category is ‘0’ White-British (the category with the highest number of participants) so, as before, we will use this as the reference category.
Change the selection to ‘First’ and click ‘Change’.

For the Gender variable we only have two categories and could use either male (‘0’) or female (‘1’) as the reference. Previously we have used male as the reference so we will stick with this (once again, change the selection to ‘First’ and click ‘Change’).

For Socio Economic Class (sec) we will use the least affluent class (code 8) as the reference (‘Never worked/long term unemployed - 8’). This time we will use the ‘Last’ option given that the SEC categories are coded such that the least affluent one is assigned the highest value code. Remember to click ‘Change’! You will see that your selections have appeared in brackets next to each variable and you can click ‘Continue’ to close the submenu.

No comments: