Discussion:
Coding Question SPSS - Syntax Coding
(too old to reply)
Aa M
2022-08-31 14:08:30 UTC
Permalink
Hello!
First off, I am a newbie when it comes to SPSS!

I am trying to create an index, but I cannot get the coding worked out (I also tried the menu functions, but that did not work either).
I want to recode three indexes with yes/no answers into one index:

NUMERIC NewIndex.
COMPUTE NewIndex = SUM((Old1, Old2, Old3)/3).
EXECUTE.

I have tried different versions of code, hoping to luck out. The example above is one of the versions... The output did not make sense - either a table that listed fractions (which I think has to do with divisor) or just a ranking...

Thank you for your feedback!
Rich Ulrich
2022-08-31 17:32:36 UTC
Permalink
Post by Aa M
Hello!
First off, I am a newbie when it comes to SPSS!
I am trying to create an index, but I cannot get the coding worked out (I also tried the menu functions, but that did not work either).
NUMERIC NewIndex.
COMPUTE NewIndex = SUM((Old1, Old2, Old3)/3).
EXECUTE.
I have tried different versions of code, hoping to luck out. The example above is one of the versions... The output did not make sense - either a table that listed fractions (which I think has to do with divisor) or just a ranking...
Thank you for your feedback!
I don't understand what you mean by 'index'. The possibilities
are limited, so, here is my guess.

If you want to create a composite for three 0/1 variables
which codes all combinations into a 0-7 variable, you can use -

COMPUTE NewIndex = 4*Old1 + 2*Old2 + Old3.

Answers of 000 are coded to 0, 111 coded to 7.

If your dichotomies are scored 1/2, change the line of code
so that each each OldX is replaced by (OldX-1) .

If you want to have a LISTing where the choices are apparent
to the eye, you can create NewIndex2 by changing 4* to 100* ,
and 2* to 10*. In that case, an original 1/2 set would have
listed results running from 111 to 222.
--
Rich Ulrich
Loading...