Reputation: 111
I would create a variable in SPSS
and add it in the existing dataset. Particularly this variable should be: x-y
if x>y
and 0
if x<=y
(x
and y
are variables in the dataset). How can I do?
I'm interested to learn this both writing the syntax of the script as using the guided tool "compute variable".
thanks in advance
Upvotes: 1
Views: 181
Reputation: 5417
There are many ways to do this. The simplest is compute z = max(x-y, 0).
Upvotes: 1