Wednesday, 1 May 2013

Creating dummy variables (from UCLA site)

* make dummies, method 1 .
COMPUTE race1=(race=1).
COMPUTE race2=(race=2).
COMPUTE race3=(race=3).
crosstabs /tables = race by race1 
          /tables = race by race2 
          /tables = race by race3.

* make dummies, method 2 .
DO REPEAT A=race1 race2 race3 /B=1 2 3.
COMPUTE A=(race=B).
END REPEAT.
crosstabs /tables = race by race1 
          /tables = race by race2 
          /tables = race by race3.
http://www.ats.ucla.edu/stat/spss/code/dummy.htm
 

2 comments:

Juan V. said...

Hi, I am a beginner in SPSS.
Mi question is:
¿Where can I find a tutorial of the programming language of SPSS?
I refer to the sintax/code you can write in scripts in order to make transformations of data and things like that.
I refer to SPSS own language, not to R or Phyton.
Thanks in advance

Myblog Work said...
This comment has been removed by a blog administrator.