Syntax errors of revised the comorbidity algorithm

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Syntax errors of revised the comorbidity algorithm

Suh-Ing Amy Hsieh
Hi all:
Sorry to resend the syntax's problem again.  I revised it by using all
suggestions but only this worked with errors.  Although this syntax was
wrong, I saw CCI values existed on each created variables. However,
frequencies were twicely difference. The result is better than first time.
Please give me your thoughtful suggestions again. Many thanks.
Amy

**Set new variable to count=0 (rather than missing)**
COMPUTE chf=0.
COMPUTE valve=0.
COMPUTE pulmcirc=0.
COMPUTE perivasc=0.
.
.
COMPUTE depress=0.
COMPUTE CCI=0.
EXECUTE.

**Create flag variables for each ICD9CM_code**
DO REPEAT dx=ICD9CM_code TO ICD9CM_code_4.
+  if any(dx, '39891', '4280', '4281', '4289') chf = 1.
+  if any(dx, '09320', '09321', '09322', '09323', '09324',
              '3940', '3941', '3942', '3949', '3950', '3951', '3952',
              '3959', '3960', '3961', '3962', '3963', '3968', '3969',
              '3970', '3971', '3979', '4240', '4241', '4242', '4243',
              '42490', '42491', '42499', '7463', '7464', '7465',
              '7466', 'V422', 'V433') valve=1.
+  if any(dx, '41511', '41519', '4160', '4161', '4168', '4169',
             '4179') pulmcirc=1.
.
.
+  if any(dx, '29500', '29501', '29502', '29503', '29504', '29505',
         '29510', '29511', '29512', '29513', '29514', '29515', '29520',
         '29521', '29522', '29523', '29524', '29525', '29530', '29531',
         '29532', '29533', '29534', '29535', '29540', '29541', '29542',
         '29543', '29544', '29545', '29550', '29551', '29552', '29553',
         '29554', '29555', '29560', '29561', '29562', '29563', '29564',
         '29565', '29570', '29571', '29572', '29573', '29574', '29575',
         '29580', '29581', '29582', '29583', '29584', '29585', '29590',
         '29591', '29592', '29593', '29594', '29595', '29600', '29601',
         '29602', '29603', '29604', '29605', '29606', '29610', '29611',
         '29612', '29613', '29614', '29615', '29616', '29620', '29621',
         '29622', '29623', '29624', '29625', '29626', '29630', '29631',
         '29632', '29633', '29634', '29635', '29636', '29640', '29641',
         '29642', '29643', '29644', '29645', '29646', '29650', '29651',
         '29652', '29653', '29654', '29655', '29656', '29660', '29661',
         '29662', '29663', '29664', '29665', '29666', '2967', '29680',
         '29681', '29682', '29689', '29690', '29699', '2970', '2971',
         '2972', '2973', '2978', '2979', '2980', '2981', '2982', '2983',
         '2984', '2988', '2989', '29910', '29911') psych=1.
+  if any(dx, '3004', '30112', '3090', '3091', '311') depress=1.
end if.
end repeat.

Error # 4007 in column 18.  Text: .
The expression is incomplete.  Check for missing operands, invalid
operators, unmatched parentheses or excessive string length. This command
not executed.

Error # 4285 in column 4.  Text: IF
Incorrect variable name: either the name is more than 64 characters, or it
is not defined by a previous command. This command not executed.

Error # 4070.  Command name: END IF
The command does not follow an unclosed DO IF command.  Maybe the DO IF
command was not recognized because of an error.  Use the level-of-control
shown to the left of the SPSS commands to determine the range of LOOPs and
DO IFs. This command not executed.

**Create one variable reflecting comorbidity**.
if chf=1 CCI=1.
if valve=1 CCI=1.
if pulmcirc=1 CCI=1.
if perivasc=1 CCI=1.
if htn=1 CCI=1.
.
.
if psych=1 CCI=1.
if depress=1 CCI=1.

**Initialize hypertension, CHF, and renal comorbidity flags
  to 1 using the detail hypertension flags**
IF htnpreg=1 THEN htncx=1.
IF htnwochf=1 THEN htncx=1.
DO IF htnchf=1.
COMPUTE htncx=1.
COMPUTE chf=1.
END IF.

IF hrenworf=1 THEN htncx=1.
DO IF hrenwrf=1.
COMPUTE htncx=1.
COMPUTE renlfail=1.
END IF.

IF hhrwohrf=1 THEN htncx=1.
DO IF hhrwchf=1.
COMPUTE htncx=1.
COMPUTE chf=1.
END IF.

DO IF hhrwrf=1.
COMPUTE htncx=1.
COMPUTE renlfail=1.
END IF.

DO IF hhrwhrf=1.
COMUPTE htncx=1.
COMPUTE chf=1
COMPUTE renlfail=1.
END IF.

IF ohtnpreg=1 THEN htncx=1.

**Set up code to only count the more severe comorbidity**
IF htncx=1 THEN htn=0.
IF mets=1 THEN tumor=0.
IF dmcx=1 THEN dm=0.

Error # 4382 in column 19.  Text: htncx
An equals sign was not found when expected after a target variable in a
COMPUTE command. This command not executed.

Error # 4285 in column 7.  Text: htnchf
Incorrect variable name: either the name is more than 64 characters, or it
is not defined by a previous command. This command not executed.

Error # 4070.  Command name: END IF
The command does not follow an unclosed DO IF command.  Maybe the DO IF
command was not recognized because of an error.  Use the level-of-control
shown to the left of the SPSS commands to determine the range of LOOPs
and>DO IFs. This command not executed.

Error # 4381 in column 1.  Text: COMPUTE
The expression ends unexpectedly. This command not executed.

Error # 4382 in column 17.  Text: htn
An equals sign was not found when expected after a target variable in a
COMPUTE command. This command not executed.

Error # 4382 in column 16.  Text: tumor
An equals sign was not found when expected after a target variable in a
COMPUTE command. This command not executed.

Error # 4382 in column 16.  Text: dm
An equals sign was not found when expected after a target variable in a
COMPUTE command. This command not executed.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Syntax errors of revised the comorbidity algorithm

Maguin, Eugene
Amy,

Change this

**Set up code to only count the more severe comorbidity**
IF htncx=1 THEN htn=0.
IF mets=1 THEN tumor=0.
IF dmcx=1 THEN dm=0.

To this

**Set up code to only count the more severe comorbidity**.
IF htncx=1 htn=0.
IF mets=1 tumor=0.
IF dmcx=1 dm=0.

I think you are used to sas. spss is different. Comments should terminate
with a period.

And, change this

**Create flag variables for each ICD9CM_code**

To this

**Create flag variables for each ICD9CM_code**.

I'd like to think that is causing the first error because I don't see
anything else wrong but perhaps someone else has sharper eyes.

Gene Maguin

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD