DISC 4.0 ALGORITHMS -Module A - Youth Panic Disorder
Diagnostic criteria for 300.01 Panic Disorder Without Agoraphobia
- Both (1) and (2):
- recurrent unexpected Panic Attacks (see p. 395)
Criteria for Panic Attack
Note: A Panic Attack is not a codable disorder. Code the specific diagnosis in which the Panic Attack occurs (e.g., 300.21 Panic Disorder With Agoraphobia [p. 402]).
A discrete period of intense fear or discomfort, in which four (or more) of the following symptoms developed abruptly and reached a peak within 10 minutes:
- palpitations, pounding heart, or accelerated heart rate
- sweating
- trembling or shaking
- sensations of shortness of breath or smothering
- feeling of choking
- chest pain or discomfort
- nausea or abdominal distress
- feeling dizzy, unsteady, lightheaded, or faint
- derealization (feelings of unreality) or depersonalization (being detached from oneself)
- fear of losing control or going crazy
- fear of dying
- paresthesias (numbness or tingling sensations)
- chills or hot flushes
- at least one of the attacks has been followed by 1 month (or more)of one (or more) of the following:
- persistent concern about having additional attacks
- worry about the implications of the attack or its consequences (e.g., losing control, having a heart attack, "going crazy")
- a significant change in behavior related to the attacks
- Absence of Agoraphobia (see p. 396).
- The Panic Attacks are not due to the direct physiological effects of a substance (e.g., a drug of abuse, a medication) or a general medical condition (e.g., hyperthyroidism).
- The Panic Attacks are not better accounted for by another mental disorder, such as Social Phobia (e.g., occurring on exposure to feared social situations), Specific Phobia (e.g., on exposure to a specific phobic situation), Obsessive-Compulsive Disorder (e.g., on exposure to dirt in someone with an obsession about contamination), Posttraumatic Stress Disorder (e.g., in associated with a severe stressor), or Separation Anxiety Disorder (e.g., in response to being away from home or close relatives).
Diagnostic criteria for 300.21 Panic Disorder With Agoraphobia
- Both (1) and (2):
- recurrent unexpected Panic Attacks (see p. 395)
- at least one of the attacks has been followed by 1 month (or more) of one (or more) of the following:
- persistent concern about having additional attacks
- worry about the implications of the attack or its consequences (e.g., losing control, having a heart attack, "going crazy")
- a significant change in behavior related to the attacks
- The presence of Agoraphobia (see p. 396).
- The Panic Attacks are not due to the direct physiological effects of a substance (e.g., a drug of abuse, a medication) or a general medical condition (e.g., hyperthyroidism).
- The Panic Attacks are not better accounted for by another mental disorder, such as Social Phobia (e.g., occurring on exposure to feared social situations), Specific Phobia (e.g., on exposure to a specific phobic situation), Obsessive-Compulsive Disorder (e.g.,on exposure to dirt in someone with an obsession about contamination),Posttraumatic Stress Disorder (e.g., in response to stimuli associated with a severe stressor), or Separation Anxiety Disorder (e.g., in response to being away from home or close relatives).
Diagnostic Criteria for Agoraphobia without Panic Disorder:
- Has met the criteria for Agoraphobia.
- No Panic Disorder.
DISC 4.0 ALGORITHMS -Module A - Youth Panic Disorder - Data Definition
Libname sds "&path";
filename discy "&filein";
data sds.ypa0 (drop = card testid) ;
infile discy end = last pad;
input id $ 1-10 card $ 11-14 @;
testid = id;
%huid;
do until (testid ne id);
select (card);
when ('A401') do;
input id $ 1-10
ypa001 16
ypa001a 17
ypa001b 18
ypa001c 19
ypa001d 20
ypa001e 21
ypa001f 22
ypa001g 23
ypa001h 24
ypa001i 25
ypa001j 26
ypa001k 27
ypa001l 28
ypa001m 29
ypa001n 30
ypa001o 31
ypa001p 32
ypa001q 33
ypa001r 34
ypa001s 35
ypa001t 36
ypa001u 37
ypa001v 38
ypa001w 39
ypa001x 40
ypa002 41
ypa002a 42
ypa002b 43
ypa002c 44
ypa002d 45
ypa002e 46
ypa002f 47
ypa002g 48
ypa002h 49
ypa002i 50
ypa002j 51
ypa002k 52
ypa002l 53
ypa002m 54
ypa002n 55
ypa002o 56
ypa002p 57
ypa002q 58
ypa002r 59
ypa002s 60
ypa002t 61
ypa002u 62
ypa002v 63
ypa002w 64
ypa002x 65
ypa003 66
ypa003a 67
ypa003b 68
ypa003c 69
ypa003d 70
ypa003e 71
ypa003f 72-73
ypa003g 74;
end;
when ('A402') do;
input id $ 1-10
ypa003h 16
ypa003i 17
ypa003j 18
ypa003k 19
ypa003l 20
ypa003m 21
ypa003n 22
ypa003o 23
ypa003p 24
ypa003q 25
ypa003r 26
ypa003s 27
ypa003t 28
ypa003u 29
ypa003v 30
ypa003w 31
ypa003x 32
ypa003y 33
ypa003z 34
ypa003aa 35
ypa004 36
ypa004a 37-38
ypa004b 39
ypa004c 40-41
ypa005 42
ypa005a 43
ypa005b 44
ypa006 45
ypa006a 46
ypa006b 47
ypa007 48
ypa007a 49
ypa007b 50
ypa008 51
ypa008a 52
ypa008b 53
ypa008c 54
ypa009 55
ypa009a 56
ypa010 57
ypa010a 58
ypa011 59
ypa011a 60
ypa012y 61-62
ypa012z 63-64
ypa012a 65
ypa012b 66
ypa012c 67
ypa012dy 68-69
ypa012dz 70-71
ypa012e 72;
end;
when ('A403') do;
input id $ 1-10
ypa013 16
ypa013a 17
ypa014 18
ypa014a 19
ypa015 20
ypa015a 21
ypa016 22
ypa016a 23
ypa017 24
ypa017a 25
ypa018 26
ypa018a 27
ypa019 28
ypa019a 29
ypa020 30-31
ypa020a 32-33
ypa021 34
ypa021ay 35-36
ypa021az 37-38;
end; /* end WHEN ... DO */
otherwise input;
end; /* end SELECT */
testid = id;
if (last) then id = ' ';
else input id $ 1-10 card $ 11-14 @@;
end; /* end DO UNTIL */
id = testid;
LABEL
YPA001 = 'A sudden attack of fear in past year'
YPA002 = 'Suddenly felt like they had restricted breathing/were suffocating'
YPA003 = 'Time when heart suddenly beat very fast'
YPA004 = 'In past year, had 3 or more attacks of feeling very afraid or strange'
YPA005 = 'In past year, After sudden attack of feeling very strange was worried about another'
YPA006 = 'Attacks caused belief that there was something wrong with heart/body part'
YPA007 = 'In past year felt/said they were going crazy because of attacks'
YPA008 = 'Stopped going places due to fear of attacks, in past year'
YPA009 = 'Attacks occured when embarrassed because people were watching'
YPA010 = 'Attacks occurred when upset about having to leave attachment figure'
YPA011 = 'Only gets attacks when near certain fear/phobia'
YPA012y = 'Age of first getting attack of feeling strange/nervous'
YPA012z = 'Grade of first getting attack of feeling strange/nervous'
YPA013 = 'Caretakers became upset that at the time attacks caused the most problems'
YPA014 = 'Attacks prevented doing things/going places with family'
YPA015 = 'Attacks prevented doing things/going places with peers'
YPA016 = 'When problems were worst it was difficult to do schoolwork/work'
YPA017 = 'Difficulties due to attacks caused teachers/boss to be upset/annoyed'
YPA018 = 'Felt bad or upset about having attacks'
YPA019 = 'In last year been to a hospita/clinic/someone at work because of attacks'
YPA020 = 'Name of person seen because of attacks (OPTIONAL)'
YPA021 = 'Attacks ever worse than past year, since age of 5';
run;
DISC 4.0 ALGORITHMS -Module A - Youth Panic Disorder - Data Recoding
Data recoding
99, 9, 77, 7 -> missing
88, 8 -> 0
data sds.ypa1;
set sds.ypa0;
array ypavar(*)
ypa001 ypa001a ypa001b ypa001c ypa001d ypa001e ypa001f ypa001g ypa001h
ypa001i ypa001j ypa001k ypa001l ypa001m ypa001n ypa001o ypa001p ypa001q
/* Corrected ELS 2/25/05 */
ypa001r ypa001s ypa001t ypa001u ypa001v ypa001w ypa001x
/* ypa001r pa001s ypa001t ypa001u ypa001v ypa001w ypa001x*/
ypa002 ypa002a ypa002b ypa002c ypa002d ypa002e ypa002f ypa002g ypa002h
ypa002i ypa002j ypa002k ypa002l ypa002m ypa002n ypa002o ypa002p ypa002q
ypa002r ypa002s ypa002t ypa002u ypa002v ypa002w ypa002x
ypa003 ypa003a ypa003b ypa003c ypa003d ypa003e ypa003g ypa003h
ypa003i ypa003j ypa003k ypa003l ypa003m ypa003n ypa003o ypa003p ypa003q
ypa003r ypa003s ypa003t ypa003u ypa003v ypa003w ypa003x ypa003y ypa003z ypa003aa
ypa004 ypa004b
ypa005 ypa005a ypa005b
ypa006 ypa006a ypa006b
ypa007 ypa007a ypa007b
ypa008 ypa008a ypa008b ypa008c
ypa009 ypa009a
ypa010 ypa010a
ypa011 ypa011a
ypa012a ypa012b ypa012c ypa012e
ypa019 ypa019a
ypa021 ypa013 ypa014 ypa015 ypa016 ypa017 ypa018;
do i = 1 to dim(ypavar);
if (ypavar(i) = 9 or ypavar(i) = 7) then ypavar(i) = .;
end;
array double(*)
ypa003f
ypa004a ypa004c
ypa012y ypa012z
ypa012dy ypa012dz
ypa020 ypa020a
ypa021ay ypa021az;
do i = 1 to dim(double);
if (double(i) = 99 or double(i) = 77) then double(i) = .;
if (double(i) = 88) then double(i) = 0;
end;
array eight(*)
ypa016
ypa017;
do i = 1 to dim(eight);
if (eight(i) = 8) then eight(i) = 0;
end;
run;
DISC 4.0 ALGORITHMS -Module A - Youth Panic Disorder - Algorithms
proc sort data = sds.ypa1; by id;
proc sort data = sds.yag2; by id;
proc sort data = sds.yso2; by id;
proc sort data = sds.ysa2; by id;
proc sort data = sds.ysp2; by id;
data sds.ypa2
(keep = id huid ypa1a1 ypa2a1 ypa3a1 ypaa1 ypaa2y ypaa2m ypaa2ay ypaa2by ypaa2cy ypaa2am
ypaa2bm ypaa2cm ypa1ay ypa2ay ypa3ay ypa1am ypa2am ypa3am ypa1c ypa2c ypa3c
ypay ypam yagnpay yagnpam ypanagy ypanagm ypawagy ypawagm
ypaima1 ypaima2 ypaima3 ypaima4 ypaima5 ypaima6
ypaima ypayima ypamima ypaimb ypayimb ypamimb
ypaimc1 ypaimc2 ypaimc3 ypaimc4 ypaimc5 ypaimc6 ypaimc ypayimc ypamimc ypayimd ypamimd
ypacrity ypacritm ypasymp
ypa001 ypa002 ypa003);
merge sds.ypa1 sds.yag2 sds.yso2 sds.ysa2 sds.ysp2;
by id;
****** Criteria for PANIC DISORDER ******;
array ypanic1(*) ypa001d ypa001e ypa001f ypa001g ypa001h ypa001i ypa001j ypa001k ypa001l ypa001m ypa001n
ypa001o ypa001p ypa001q ypa001r;
array ypanic2(*) ypa004-ypa021;
array ypanic3(*) ypa002e ypa002f ypa002g ypa002h ypa002i ypa002j ypa002k ypa002l ypa002m ypa002n
ypa002o ypa002p ypa002q ypa002r;
array ypanic4(*) ypa003h ypa003i ypa003j ypa003k ypa003l ypa003m ypa003n ypa003o ypa003p ypa003q
ypa003r ypa003s ypa003t ypa003u;
if ypa001 = 0 or ypa001a = 0 or ypa001c=0 then do; do i = 1 to dim(ypanic1); ypanic1(i)=0;end; end;
if ypa001v=0 or (ypa001v=2 and ypa001w=2) then do; ypa002=0;ypa003=0; end;
if ypa001=2 and
((0<=sum((ypa001d=1 or ypa001d=2), (ypa001e=1 or ypa001e=2), (ypa001f=1 or ypa001f=2), (ypa001g=1 or ypa001g=2),
(ypa001h=1 or ypa001h=2), (ypa001i=1 or ypa001i=2), (ypa001j=1 or ypa001j=2), (ypa001k=1 or ypa001k=2),
(ypa001l=1 or ypa001l=2), (ypa001m=1 or ypa001m=2), (ypa001n=1 or ypa001n=2), (ypa001o=1 or ypa001o=2),
(ypa001p=1 or ypa001p=2), (ypa001q=1 or ypa001q=2), (ypa001r=1 or ypa001r=2))<=1
and n(of ypa001d ypa001e ypa001f ypa001g ypa001h ypa001i ypa001j ypa001k ypa001l ypa001m ypa001n
ypa001o ypa001p ypa001q ypa001r)>=1)
or ypa001u=0 or ypa001w=0)
then do;ypa002=0;ypa003=0; do i = 1 to dim(ypanic2); ypanic2(i)=0; end; end;
if ypa002=0 or ypa002b=0 or ypa002c=0 or ypa002d=0 then do; do i=1 to dim(ypanic3); ypanic3(i)=0;end; end;
if ypa002v=0 or (ypa002v=2 and ypa002w=2) then ypa003=0;
if ypa002=2 and
((0<=sum((ypa002e=1 or ypa002e=2), (ypa002f=1 or ypa002f=2), (ypa002g=1 or ypa002g=2),
(ypa002h=1 or ypa002h=2), (ypa002i=1 or ypa002i=2), (ypa002j=1 or ypa002j=2), (ypa002k=1 or ypa002k=2),
(ypa002l=1 or ypa002l=2), (ypa002m=1 or ypa002m=2), (ypa002n=1 or ypa002n=2), (ypa002o=1 or ypa002o=2),
(ypa002p=1 or ypa002p=2), (ypa002q=1 or ypa002q=2), (ypa002r=1 or ypa002r=2))<=1
and n(of ypa002e ypa002f ypa002g ypa002h ypa002i ypa002j ypa002k ypa002l ypa002m ypa002n ypa002o
ypa002p ypa002q ypa002r)>=1)
or ypa002u=0 or ypa002w=0)
then do; ypa003=0; do i=1 to dim(ypanic2); ypanic2(i)=0; end; end;
if ypa003=0 or ypa003c=0 or ypa003d=0 or ypa003g=0 then do; do i=1 to dim(ypanic4); ypanic4(i)=0; end; end;
if ypa003=2 and
((0<=sum((ypa003s=1 or ypa003s=2), (ypa003t=1 or ypa003t=2), (ypa003u=1 or ypa003u=2),
(ypa003h=1 or ypa003h=2), (ypa003i=1 or ypa003i=2), (ypa003j=1 or ypa003j=2), (ypa003k=1 or ypa003k=2),
(ypa003l=1 or ypa003l=2), (ypa003m=1 or ypa003m=2), (ypa003n=1 or ypa003n=2), (ypa003o=1 or ypa003o=2),
(ypa003p=1 or ypa003p=2), (ypa003q=1 or ypa003q=2), (ypa003r=1 or ypa003r=2))<=1
and n(of ypa003h ypa003i ypa003j ypa003k ypa003l ypa003m ypa003n ypa003o ypa003p ypa003q ypa003r
ypa003s ypa003t ypa003u)>=1)
or ypa003x=0 or ypa003z=0)
then do; do i=1 to dim(ypanic2); ypanic2(i)=0; end; end;
array impair(6) ypa013 ypa014 ypa015 ypa016 ypa017 ypa018;
array impaira(6) ypa013a ypa014a ypa015a ypa016a ypa017a ypa018a;
do i=1 to 6;
if impair[i]=0 then impaira[i]=1;
end;
*-----A;
*-----A1;
** Type I **;
if ((ypa001b = 0 or ypa001c = 2)
and (sum((1<=ypa001f<=2),(1<=ypa001h<=2),(1<=ypa001g<=2),(1<=ypa001d<=2),
(1<=ypa001i<=2),(1<=ypa001n<=2),(1<=ypa001k<=2),(1<=ypa001e<=2),
((1<=ypa001q<=2) or (1<=ypa001r<=2)),(1<=ypa001o<=2),(1<=ypa001p<=2),
(1<=ypa001l<=2),(1<=ypa001m<=2)) ge 4)
and (ypa001s = 2)) then ypa1a1 = 1;
else if (ypa001 = 0 or ypa001a = 0 or (ypa001b = 2 and ypa001c = 0)
or (sum((ypa001f=0),(ypa001h=0),(ypa001g=0),(ypa001d=0),(ypa001i=0),(ypa001n=0),
(ypa001k=0),(ypa001e=0),(ypa001q=0 and ypa001r=0),(ypa001o=0),(ypa001p=0),
(ypa001l=0),(ypa001m=0)) ge 10)
or (ypa001s = 0)) then ypa1a1 = 0;
** Type II **;
if ((ypa002d = 2)
and (sum((1<=ypa002f<=2),(1<=ypa002h<=2),(1<=ypa002g<=2),(1<=ypa002i<=2),
(1<=ypa002n<=2),(1<=ypa002k<=2),(1<=ypa002e<=2),
((1<=ypa002q<=2) or (1<=ypa002r<=2)),(1<=ypa002o<=2),(1<=ypa002p<=2),
(1<=ypa002l<=2),(1<=ypa002m<=2)) ge 3)
and (ypa002s = 2)) then ypa2a1 = 1;
else if ((ypa002 = 0 or (ypa002a = 2 and ypa002b = 0) or ypa002c = 0 or ypa002d = 0)
or (sum((ypa002f=0),(ypa002h=0),(ypa002g=0),(ypa002i=0),(ypa002n=0),(ypa002k=0),
(ypa002e=0),(ypa002q=0 and ypa002r=0),(ypa002o=0),(ypa002p=0),(ypa002l=0),
(ypa002m=0)) ge 10)
or (ypa002s = 0)) then ypa2a1 = 0;
** Type III **;
if ((ypa003g = 2)
and (sum((1<=ypa003k<=2),(1<=ypa003j<=2),(1<=ypa003h<=2),(1<=ypa003l<=2),
(1<=ypa003q<=2),(1<=ypa003n<=2),(1<=ypa003i<=2),((1<=ypa003t<=2) or
(1<=ypa003u<=2)),(1<=ypa003r<=2),(1<=ypa003s<=2),(1<=ypa003o<=2),
(1<=ypa003p<=2)) ge 3)
and (ypa003v = 2)) then ypa3a1 = 1;
else if ((ypa003 = 0 or ypa003c = 0 or ypa003d = 0 or ypa003g = 0)
or (sum((ypa003k=0),(ypa003j=0),(ypa003h=0),(ypa003l=0),(ypa003q=0),(ypa003n=0),
(ypa003i=0),(ypa003t=0 and ypa003u=0),(ypa003r=0),(ypa003s=0),(ypa003o=0),
(ypa003p=0)) ge 10)
or (ypa003v = 0)) then ypa3a1 = 0;
if ypa1a1=1 or ypa2a1=1 or ypa3a1=1 then ypaa1=1;
else if ypa1a1=0 and ypa2a1=0 and ypa3a1=0 then ypaa1=0;
*-----A2;
** Type I, II, III are the same **;
if ypa005a=2 then ypaa2ay = 1;
else if (ypa005=0 or ypa005a=0) then ypaa2ay = 0;
if (ypa006a = 2 or ypa007a = 2) then ypaa2by = 1;
else if ((ypa006 = 0 or ypa006a = 0) and (ypa007 = 0 or ypa007a = 0)) then ypaa2by = 0;
if ypa008=2 then ypaa2cy = 1;
else if ypa008=0 then ypaa2cy = 0;
if (ypa005a = 2 OR (ypa006a = 2 or ypa007a = 2) OR ypa008 = 2) then ypaa2y = 1;
else if ((ypa005 = 0 or ypa005a = 0) AND ((ypa006 = 0 or ypa006a = 0) and
(ypa007 = 0 or ypa007a = 0)) AND (ypa008 = 0)) then ypaa2y = 0;
if ypa005b = 2 then ypaa2am = 1;
else if (ypa005 = 0 or ypa005a = 0 or ypa005b = 0) then ypaa2am = 0;
if (ypa006b = 2 or ypa007b = 2) then ypaa2bm = 1;
else if ((ypa006 = 0 or ypa006a = 0 or ypa006b = 0) and (ypa007 = 0 or ypa007a = 0 or ypa007b = 0))
then ypaa2bm = 0;
if ypa008b=2 then ypaa2cm = 1;
else if (ypa008 = 0 or ypa008b = 0) then ypaa2cm = 0;
if (ypa005b = 2 OR (ypa006b = 2 or ypa007b = 2) OR ypa008b = 2) then ypaa2m = 1;
else if ((ypa005 = 0 or ypa005a = 0 or ypa005b = 0) AND ((ypa006 = 0 or ypa006a = 0
or ypa006b = 0) and (ypa007 = 0 or ypa007a = 0 or ypa007b = 0)) AND (ypa008 = 0 or
ypa008b = 0)) then ypaa2m = 0;
*-----Past Year;
if (ypa1a1 = 1 and ypaa2y = 1) then ypa1ay = 1; /* type I */
else if (ypa1a1 = 0 or ypaa2y = 0) then ypa1ay = 0;
if (ypa2a1 = 1 and ypaa2y = 1) then ypa2ay = 1; /* type II */
else if (ypa2a1 = 0 or ypaa2y = 0) then ypa2ay = 0;
if (ypa3a1 = 1 and ypaa2y = 1) then ypa3ay = 1; /* type III */
else if (ypa3a1 = 0 or ypaa2y = 0) then ypa3ay = 0;
*-----Past Month;
if (ypa1a1 = 1 and ypaa2m = 1) then ypa1am = 1; /* type I */
else if (ypa1a1 = 0 or ypaa2m = 0) then ypa1am = 0;
if (ypa2a1 = 1 and ypaa2m = 1) then ypa2am = 1; /* type II */
else if (ypa2a1 = 0 or ypaa2m = 0) then ypa2am = 0;
if (ypa3a1 = 1 and ypaa2m = 1) then ypa3am = 1; /* type III */
else if (ypa3a1 = 0 or ypaa2m = 0) then ypa3am = 0;
*-----B;
/* Depends on which disorder PANIC is co-assessed with */
*-----C;
** Type I **;
if ((ypa001t = 0 or ypa001u = 2) and (ypa001v = 0 or ypa001w = 2))
then ypa1c = 1;
else if ((ypa001 = 0 or ypa001a = 0) or (ypa001b = 2 and ypa001c = 0) or
(ypa001t = 2 and ypa001u = 0) or (ypa001v = 2 and ypa001w = 0))
then ypa1c = 0;
** Type II **;
if ((ypa002t = 0 or ypa002u = 2) and (ypa002v = 0 or ypa002w = 2))
then ypa2c = 1;
else if ((ypa002 = 0 or (ypa002a =2 and ypa002b = 0) or ypa002c = 0 or
ypa002d = 0) or (ypa002t = 2 and ypa002u = 0) or (ypa002v = 2 and ypa002w = 0))
then ypa2c = 0;
** Type III **;
if ((ypa003w = 0 or ypa003x = 2) and (ypa003y = 0 or ypa003z = 2))
then ypa3c = 1;
else if ((ypa003 = 0 or ypa003c = 0 or ypa003d = 0 or ypa003g = 0)
or (ypa003w = 2 and ypa003x = 0) or (ypa003y = 2 and ypa003z = 0))
then ypa3c = 0;
*-----D; /* not covered */
/** If you want to assess, you can use the following program:
** Type I, II, III are the same **;
if (ysoy = 0 or (ysoy = 1 and (ypa009 = 0 or ypa009a = 2))) and
(ysay = 0 or (ysay = 1 and (ypa010 = 0 or ypa010a = 2))) and
(yspy = 0 or (yspy = 1 and (ypa011 = 0 or ypa011a = 2)))
then ypady = 1;
else if (ysoy = 1 and (ypa009 = 2 and ypa009a = 0))
or (ysay = 1 and (ypa010 = 2 and ypa010a = 0))
or (yspy = 1 and (ypa011 = 2 and ypa011a = 0))
then ypady = 0;
if (ysom = 0 or (ysom = 1 and (ypa009 = 0 or ypa009a = 2))) and
(ysam = 0 or (ysam = 1 and (ypa010 = 0 or ypa010a = 2))) and
(yspm = 0 or (yspm = 1 and (ypa011 = 0 or ypa011a = 2)))
then ypadm = 1;
else if (ysom = 1 and (ypa009 = 2 and ypa009a = 0))
or (ysam = 1 and (ypa010 = 2 and ypa010a = 0))
or (yspm = 1 and (ypa011 = 2 and ypa011a = 0))
then ypadm = 0;
**/
/* Create ypa1y, ypa1m, ypa2y, ypa2m, ypa3y, and ypa3m for the three types of attacks */
/* Past year */
if (ypa1ay = 1 and ypa1c = 1) then ypa1y = 1;
else if (ypa1ay = 0 or ypa1c = 0 ) then ypa1y = 0;
if (ypa2ay = 1 and ypa2c = 1 ) then ypa2y = 1;
else if (ypa2ay = 0 or ypa2c = 0 ) then ypa2y = 0;
if (ypa3ay = 1 and ypa3c = 1 ) then ypa3y = 1;
else if (ypa3ay = 0 or ypa3c = 0 ) then ypa3y = 0;
if (ypa1y = 1 or ypa2y = 1 or ypa3y = 1) then ypay = 1;
else if (ypa1y = 0 and ypa2y = 0 and ypa3y = 0) then ypay = 0;
/* Past month */
if (ypa1am = 1 and ypa1c = 1 ) then ypa1m = 1;
else if (ypa1am = 0 or ypa1c = 0 ) then ypa1m = 0;
if (ypa2am = 1 and ypa2c = 1 ) then ypa2m = 1;
else if (ypa2am = 0 or ypa2c = 0 ) then ypa2m = 0;
if (ypa3am = 1 and ypa3c = 1 ) then ypa3m = 1;
else if (ypa3am = 0 or ypa3c = 0 ) then ypa3m = 0;
if (ypa1m = 1 or ypa2m = 1 or ypa3m = 1) then ypam = 1;
else if (ypa1m = 0 and ypa2m = 0 and ypa3m = 0) then ypam = 0;
****** Diagnosis for Panic Disorder Without Agoraphobia ******;
if (ypay = 1 and yagy = 0) then ypanagy = 1;
else if (ypay = 0 or yagy = 1) then ypanagy = 0;
if (ypam = 1 and yagm = 0) then ypanagm = 1;
else if (ypam = 0 or yagm = 1) then ypanagm = 0;
****** Diagnosis for Panic Disorder with Agoraphobia ******;
if (ypay = 1 and yagy = 1) then ypawagy = 1;
else if (ypay = 0 or yagy = 0) then ypawagy = 0;
if (ypam = 1 and yagm = 1) then ypawagm = 1;
else if (ypam = 0 or yagm = 0) then ypawagm = 0;
****** Diagnosis for Agoraphobia without Panic Disorder ******;
if (yagy = 1 and ypay = 0) then yagnpay = 1;
else if (yagy = 0 or ypay = 1) then yagnpay = 0;
if (yagm = 1 and ypam = 0) then yagnpam = 1;
else if (yagm = 0 or ypam = 1) then yagnpam = 0;
****** Variable Labels ******;
label
ypa1a1 = 'Panic attack type 1'
ypa2a1 = 'Panic attack type 2'
ypa3a1 = 'Panic attack type 3'
ypaa2y = 'Concern about attack or change in behavior'
ypa1c = 'Not due to substance or medical condition - type 1'
ypa2c = 'Not due to substance or medical condition - type 2'
ypa3c = 'Not due to substance or medical condition - type 3'
ypay = 'Past year: panic disorder'
ypam = 'Past month: panic disorder'
ypanagy = 'Past year: panic without agoraphobia'
ypanagm = 'Past month: panic without agoraphobia'
ypawagy = 'Past year: panic with agoraphobia'
ypawagm = 'Past month: panic with agoraphobia'
yagnpay = 'Past year: agoraphobia without panic'
yagnpam = 'Past month: agoraphobia without panic';
*----Impairment Algorithms;
*------A; /* One intermediate rating of impairment or distress */
if (ypa013a = 2 or ypa013a = 3) then ypaima1 = 1;
else if (ypa013a = 1 or ypa013a = 7 or ypa013a = 9) then ypaima1 = 0;
if (ypa014a = 2 or ypa014a = 3) then ypaima2 = 1;
else if (ypa014a = 1 or ypa014a = 7 or ypa014a = 9) then ypaima2 = 0;
if (ypa015a = 2 or ypa015a = 3) then ypaima3 = 1;
else if (ypa015a = 1 or ypa015a = 7 or ypa015a = 9) then ypaima3 = 0;
if (ypa016a = 2 or ypa016a = 3) then ypaima4 = 1;
else if (ypa016a = 1 or ypa016a = 7 or ypa016a = 9) then ypaima4 = 0;
if (ypa017a = 2 or ypa017a = 3) then ypaima5 = 1;
else if (ypa017a = 1 or ypa017a = 7 or ypa017a = 9) then ypaima5 = 0;
if (ypa018a = 2 or ypa018a = 3) then ypaima6 = 1;
else if (ypa018a = 1 or ypa018a = 7 or ypa018a = 9) then ypaima6 = 0;
if (sum(ypaima1, ypaima2, ypaima3, ypaima4, ypaima5, ypaima6) ge 1)
then ypaima = 1;
else if ((n(ypaima1, ypaima2, ypaima3, ypaima4, ypaima5, ypaima6) - sum(ypaima1,
ypaima2, ypaima3, ypaima4, ypaima5, ypaima6)) ge 6)
then ypaima = 0;
if ypaima = 1 and ypay = 1 then ypayima = 1;
else if ypaima = 0 or ypay = 0 then ypayima = 0;
if ypaima = 1 and ypam = 1 then ypamima = 1;
else if ypaima = 0 or ypam = 0 then ypamima = 0;
*------B; /* Two intermediate ratings of impairment or distress */
if (sum(ypaima1, ypaima2, ypaima3, ypaima4, ypaima5, ypaima6) ge 2)
then ypaimb = 1;
else if ((n(ypaima1, ypaima2, ypaima3, ypaima4, ypaima5, ypaima6) - sum(ypaima1,
ypaima2, ypaima3, ypaima4, ypaima5, ypaima6)) ge 5)
then ypaimb = 0;
if ypaimb = 1 and ypay = 1 then ypayimb = 1;
else if ypaimb = 0 or ypay = 0 then ypayimb = 0;
if ypaimb = 1 and ypam = 1 then ypamimb = 1;
else if ypaimb = 0 or ypam = 0 then ypamimb = 0;
*-----C; /* One severe ratings of impairment or distress */
if (ypa013a = 3) then ypaimc1 = 1;
else if (ypa013a = 1 or ypa013a = 2 or ypa013a = 7 or ypa013a = 9) then ypaimc1 = 0;
if ( ypa014a = 3) then ypaimc2 = 1;
else if (ypa014a = 1 or ypa014a = 2 or ypa014a = 7 or ypa014a = 9) then ypaimc2 = 0;
if ( ypa015a = 3) then ypaimc3 = 1;
else if (ypa015a = 1 or ypa015a = 2 or ypa015a = 7 or ypa015a = 9) then ypaimc3 = 0;
if (ypa016a = 3) then ypaimc4 = 1;
else if (ypa016a = 1 or ypa016a = 2 or ypa016a = 7 or ypa016a = 9) then ypaimc4 = 0;
if (ypa017a = 3) then ypaimc5 = 1;
else if (ypa017a = 1 or ypa017a = 2 or ypa017a = 7 or ypa017a = 9) then ypaimc5 = 0;
if (ypa018a = 3) then ypaimc6 = 1;
else if (ypa018a = 1 or ypa018a = 2 or ypa018a = 7 or ypa018a = 9) then ypaimc6 = 0;
if (sum(ypaimc1, ypaimc2, ypaimc3, ypaimc4, ypaimc5, ypaimc6) ge 1)
then ypaimc = 1;
else if ((n(ypaimc1, ypaimc2, ypaimc3, ypaimc4, ypaimc5, ypaimc6) - sum(ypaimc1,
ypaimc2, ypaimc3, ypaimc4, ypaimc5, ypaimc6)) ge 6)
then ypaimc = 0;
if ypaimc = 1 and ypay = 1 then ypayimc = 1;
else if ypaimc = 0 or ypay = 0 then ypayimc = 0;
if ypaimc = 1 and ypam = 1 then ypamimc = 1;
else if ypaimc = 0 or ypam = 0 then ypamimc = 0;
*------D; /* Impairment D: present when impairment B or C are satisified */
If ypayimb = 1 or ypayimc = 1 then ypayimd = 1;
else if ypayimb = 0 and ypayimc = 0 then ypayimd = 0;
If ypamimb = 1 or ypamimc = 1 then ypamimd = 1;
else if ypamimb = 0 and ypamimc = 0 then ypamimd = 0;
***Criterion Count***;
ypacrity=sum(of ypaa1 ypaa2ay ypaa2by ypaa2cy);
ypacritm=sum(of ypaa1 ypaa2am ypaa2bm ypaa2cm);
*****Symptom Count *******;
ypasymp=sum(of ypa001 ypa002 ypa003 ypa005 ypa006 ypa007 ypa008)/2;
label
ypacrity = 'Youth Panic Disorder Criteria Count - Last Year'
ypacritm = 'Youth Panic Disorder Criteria Count - Last Month'
ypasymp = 'Youth Panic Disorder Symptom Count';
run;