Take the 2-minute tour ×
Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. It's 100% free, no registration required.

It looks like you can use coding for one categorical variable, but I have two categorical and one continuous predictor variable. Can i use multiple regression for this in SPSS and if so how? thanks!

share|improve this question
    
I'm sure you can, but I'm afraid I've no idea how! –  onestop Jan 18 '11 at 20:41
    
I would suggest typing something like regression into the help documentation that comes with SPSS. Should be bread and butter stuff for any stats package –  probabilityislogic Jan 18 '11 at 22:29
    
I don't know what you mean by coding for one categorical variable. Can you give an example in syntax? Is your dependent variable continuous or categorical? –  Andy W Jan 19 '11 at 13:35

3 Answers 3

  1. If this is an SPSS syntax question, the answer is just put the categorical variable, coded appropriately, into the variable list for "independent variables" along with the continuous one.
  2. On the statistics: Is your categorical variable binary? If so, you need to use a dummy or other valid contrast code. If it is not binary, is your categorical variable ordinal or nominal? If nominal, then again, you must use some contrasting code strategy--in effect modeling the impact of each level of the variable on the outcome or "dependent" variable. If the categorical variable is ordinal, then most likely the sensible thing to do is to enter it as-is into the model, just as you would with a continuous predictor (i.e., "independent") variable. You would be assuming, in that case, that the increments between levels of the categorical predictor ("indepdent") variable; only rarely will this be a mistake, but when it is, you should again use a contrast code & model the impact of each level. This question comes up in this forum quite often -- here is a good analaysis
  3. How to handle missing data is, in my view, a completely separate matter. My understanding is that pairwise deletion is not viewed as a valid approach for multivariate regression. Listwise is pretty common but can can also bias results & certainly is a shame. Multiple imputation is a thing of beauty.
share|improve this answer

A simple way to turn categorical variables into a set of dummy variables for use in models in SPSS is using the do repeat syntax. This is the simplest to use if your categorical variables are in numeric order.

*making vector of dummy variables.
vector dummy(3,F1.0).
*looping through dummy variables using do repeat, in this example category would be the categorical variable to recode. 
do repeat dummy = dummy1 to dummy3 /#i = 1 to 3.
compute dummy = 0.
if category = #i dummy = 1.
end repeat.
execute. 

Otherwise you can simply run a set of if statements to make your dummy variables. My current version (16) has no native ability to specify a set of dummy variables automatically in the regression command (like you can in Stata using the xi command) but I wouldn't be surprised if this is available in some newer version. Also take note of dmk38's point #2, this coding scheme is assuming nominal categories. If your variable is ordinal more discretion can be used.

I also agree with dmk38 and the talk about regression being better because of its ability to specify missing data in a particular manner is a completely separate issue.

share|improve this answer

You definitely can, by following the same method you'd use for the first categorical predictor. Create dummy variables just as you would for the first such variable. But it's often easier to use SPSS's Unianova command. You can look this up in any printed or pdf'd Syntax Guide, or you can access it through Analyze...General Linear Model...Univariate.

Despite being a little more complicated, the Regression command has a number of advantages over Unianova, though. The chief one is that you can choose 'missing pairwise' (you don't have to lose a case simply because it's missing a value for one or two predictors). You can also get many valuable diagnostics such as partial plots and influence statistics.

share|improve this answer
1  
@ rolando - good answer. That being said, missing pairwise approaches tend to confuse the comparison of effects, as they are based on different numbers of observations. Might be something to keep in mind. –  richiemorrisroe Jan 19 '11 at 11:32
    
I think your slightly confused, pair-wise missing only matters if your running entirely separate models (such as using a step-wise model selection procedure). If your entering all variables into the model it still drops missing values list-wise. –  Andy W Jan 19 '11 at 13:39
    
@ richiemorrisroe - i agree, worth keeping in mind. @ Andy W - Just confirmed in SPSS that, using forced entry only, missing pairwise and missing listwise give different results in every respect, including different df. –  rolando2 Jan 25 '11 at 0:13
    
I still think your confused, how can SPSS return different sets of results by declaring missing pairwise unless it makes up values for the missing data? Here is an example using simulated data I have posted in a text file, dl.dropbox.com/u/3385251/SPSS_missing_Listwise_vs_Pairwise.txt . I have currently downvoted your answer, as all this talk about how the regression command handles missing data is confusing, has nothing to do with the OP's original question and is likely to be misleading. –  Andy W Jan 25 '11 at 4:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.