Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help with Absolute Value and Creating a New Variable

5,269 views
Skip to first unread message

Kathy

unread,
May 24, 2011, 12:43:00 AM5/24/11
to
If someone can provide some guidance on computing variables using some
absolute values of the difference between other variables, I would
appreciate it. I have been trying to compute a new variables from a
set of other variables where I perform an absolute value of the
difference between ten sets of variables and then sum up for a total
score, see below:
| EQIQ56 - EQIQ60 | + | EQIQ3 - EQIQ11 | + | EQIQ7 - EQIQ31 | +
| EQIQ30 - EQIQ22 | + | EQIQ17 - EQIQ43 | + | EQIQ20 - EQIQ51 |
+
| EQIQ26 - EQIQ35 | + | EQIQ38 - EQIQ48 | + | EQIQ40 - EQIQ47 |
+
| EQIQ55 - EQIQ59 |

I keep getting an error message of missing operands or too many
operands used. I have tried doing this several ways using the
parentheses and not and still get this error. Can anyone help?
Thanks.

Kathy

Jon

unread,
May 24, 2011, 2:56:48 AM5/24/11
to
Dear Kathy,
If I do not totally misunderstand what you are trying to do:
the absolute value function in SPSS is ABS(expression)
so
compute totscore=abs(EQIQ56 - EQIQ60)+ abs(EQIQ3 - EQIQ11)  +
abs( EQIQ7 - EQIQ31) + abs(EQIQ30 - EQIQ22)  + abs(EQIQ17 - EQIQ43)  +
 abs(EQIQ20 - EQIQ51)........
should do the trick.
best
Jon

christ...@gmail.com

unread,
Mar 24, 2013, 2:53:20 AM3/24/13
to
Thanks Jon! That really helped :)
Christa

David Marso

unread,
Mar 27, 2013, 9:54:25 AM3/27/13
to
Of course of any of the ABS(diff) terms is missing the entire function will return SYSMIS.
Depending upon what you wish to do in the presence of missing data,
Consider reading up on the SUM function.
compute totscore=SUM(abs(EQIQ56 - EQIQ60),abs(EQIQ3 - EQIQ11), ....).
0 new messages