variable creation

Nabé

New Member
#1
Hello all
I want to create a variable from the variables which have several modalities:
-gly (1 = hypoglycemia, 2 = normal, 3 = diabetes)
-tension (1 = normal, 2 = hypertension)
-dyslipi (1 = dyslipidemia, 2 = normal)
-IMC (1-nutrition, 2 = normal, 3 = obesity).
The variable I want to create should be as follows:
metabolic syndrome = (tension = 2 + gly = 2) or (tension = 2 + BMI = 3) or tension = 2 + dyslipi = 1 or gly = 3 + tension = 2 + BMI = 3 + dyslipi = 1.
thank you for helping me.
 

Karabiner

TS Contributor
#2
The structure is:
IF (...) metabolic_syndome = 1 .
EXECUTE .

In brackets, after the IF, you write your conditions. Use AND instead of +

IF ( (tension = 2 AND gly = 2) OR (...) OR (...) )

HTH

Karabiner
 

Nabé

New Member
#4
Hello Karabiner
when i did this is what comes out:

IF ( (Tension= 2 AND GLY= 3) OR (Tension = 2 AND IMCgpe2= 3) ) meta_syn =1.

Error # 4305 in column 18. Text: AND

> A relation operator can contain two or two numeric operands

> character string operands. To compare a character string

> with a numerical quantity, use the STRING or NUMBER function.

> The execution of this command stops.

how i can solve is problem with both the command and the syntax
thank you in advance
 

Nabé

New Member
#5
I believe the problem is solved when I have the figures between hook
IF (((Tension = "2" AND GLY = "3") OR (GLY = "3" AND IMCgpe2 = "3") )) sygtr=1.
VARIABLE LABELS sygtr 'IF (((Tension = "2" AND GLY = "3") OR (GLY = "3" AND IMCgpe2 = "3") )) sygtr=1 '.
EXECUTE.
Thank you