You needed DO IF, not IF:
DO IF (Ddimero >= Cutoffddimeroforage).
COMPUTE DDimeroAdj=0.
ELSE.
COMPUTE DDimeroAdj=1.
EXECUTE.
Although, with something so simple, you just do:
COMPUTE DDimeroAdj=1.
IF (Ddimero >= Cutoffddimeroforage) DDimeroAdj=0.
This will do the same through the UI:
Transform > Compute Variable...

Press OK. Go back to Transform > Compute Variable...

Then press If...

Then click Continue, then OK.
That should do it.
------------------------------
Rick Marcantonio
Quality Assurance
IBM
------------------------------
Original Message:
Sent: Fri February 10, 2023 06:31 PM
From: N P
Subject: Crosstabs with condition
Thank you once again, Rick Marcantonio.
As you suggested it may work but I'm making things a bit more complex.
I'd like to generate a var that contains a value according to other two variables (Ddimero and Cutoffddimeroforage) into the dataset.
I tried with syntax but I'm making some mistake, don't know where...
IF (Ddimero >= Cutoffddimeroforage).COMPUTE DDimeroAdj=0.ELSE.COMPUTE DDimeroAdj=1.EXECUTE.
There's a way to make this by UI?
------------------------------
N P
Original Message:
Sent: Fri February 10, 2023 11:40 AM
From: Rick Marcantonio
Subject: Crosstabs with condition
I find it easier to do in syntax. However, you can use the UI:
Transform > Compute Variable...

------------------------------
Rick Marcantonio
Quality Assurance
IBM
Original Message:
Sent: Fri February 10, 2023 11:37 AM
From: N P
Subject: Crosstabs with condition
Hi Rick Marcantonio and thank you for you're really prompt answer.
I ignored the existence of the synxtax function...
Can I create this kind of virtual groups just by the UI or I need to pass by syntax modality?
It looks like way similar to R Studio.
I'll have a look to this new programming language
------------------------------
N P
Original Message:
Sent: Fri February 10, 2023 10:33 AM
From: Rick Marcantonio
Subject: Crosstabs with condition
Hi. Try this.
In syntax:
COMPUTE Group=(My_Variable GE 10).
EXECUTE.
Then in the Crosstabs dialog:

------------------------------
Rick Marcantonio
Quality Assurance
IBM
Original Message:
Sent: Fri February 10, 2023 07:08 AM
From: N P
Subject: Crosstabs with condition
Dear group,
I am just a newbie with SPSS and I hope I'll be forgiven if my question doesn't sound like "linear" but till some days ago my mind was used to work in a "programming language paradigm".
I am using the function Analysys -> Crosstabs and I can get a nice contigency grid for my Gender patient (binomial) * My category(binomial).
Now I'd like to add an extra layer: I'd like to split, for each My category, if My variable is => 10 or < 10.
I've tried to create an extra var with a conditional content but I'm still need to get into the process of SPSS...
Hope to find someone who will be able to help me with kindness :)
Wish you a nice day!
------------------------------
N P
------------------------------