[EpiData-list] CHK file with calculations does not work as it did in EpiInfo

epidata-list at lists.umanitoba.ca epidata-list at lists.umanitoba.ca
Tue Mar 4 10:50:55 CST 2008


Hi,

I wonder if someone can spot the syntax problem in this CHK file for the Beck Depression inventory. I've struggled for hours to get it to work the way it did under Epi Info. Basically, there are three conditions in an IF statement. I've tried with the two simple conditions alone and the script works (condition at the beginning & at the end). Combining conditions always gives the 'atrisk' calculated variable the answer "N". Is there a limitation or syntax difference in Epidata??

Here's the syntax. thanks for the help.

BEFORE FILE
  DEFINE TOTALPG1 ## GLOBAL
  DEFINE TOTALPG2 ## GLOBAL
  DEFINE varID ####
END

AFTER RECORD
  TOTALPG1=N1SAD+N2DISCOURA+N3FAILURE+N4SATISFAC+N5GUILT+N6PUNISHED+N7DISAPPOI+N8SELFCRIT+N9SUICIDE+N10CRY+N11IRRITAT
  TOTALPG2=N12INTPPL+N13DECISIO+N14LOOKWOR+N15CANWORK+N16SLEEP+N17TIRED+N18APPETIT+N19WEIGHT+N20WORRYHL+N21INTSEX
  TOTAL=TOTALPG1 + TOTALPG2
  IF N9SUICIDE = 3 or (N9SUICIDE = 2 AND TOTAL >= 16) or TOTAL > 42
   THEN
    ATRISK="Y"
   ELSE
    ATRISK="N"
  ENDIF
END

idnum
  MUSTENTER
  REPEAT
  AFTER ENTRY
    VarID=IDNUM
  END
END

total
  NOENTER
END

atrisk
  NOENTER
END

n1sad
  RANGE 0 3
END

etc. for the other variables


John LeBlanc
__________________________________________________________

John C. LeBlanc, MD, MSc, FRCPC
Associate Professor
Pediatrics, Psychiatry, Community Health and Epidemiology
Dalhousie University

IWK Health Centre               Work phone: (902) 470-8930
5850 University Avenue          Work fax:   (902) 470-6913
Halifax, Nova Scotia            Email: John.LeBlanc at Dal.Ca
B3K 6R8 CANADA                  Pager:      (902) 470-8888
__________________________________________________________



More information about the EpiData-list mailing list