DISC4.0 Algorithms - Module C - Youth - Major Depression/Dysthymic Disorder
************************************************************************************
DISC4.0 Algorithms
Module C - Youth
Major Depression/Dysthymic Disorder
************************************************************************************;
*************************************************************************************
Criteria for Major Depressive Episode
- Five (or more) of the following symptoms have been present during the same 2-week period and represent a change from previous functioning, at least one of the symptoms is either (1) depressed mood or (2) loss of interest or pleasure.
Note: Do not include symptoms that are clearly due to a general medical condition, or mood-incongruent delusions or hallucinations.
- depressed mood most of the day, nearly every day, as indicated by either subjective report (e.g., feels sad or empty) or observation made by others (e.g., appears tearful). Note: In children and adolescents, can be irritable mood.
- markedly diminished interest or pleasure in all, or almost all, activities most of the day, nearly every day (as indicated by either subjective account or observation made by others)
- significant weight loss when not dieting or weight gain (e.g., a change of more than 5% of body weight in a month), or decrease or increase in appetite nearly every day. Note: In children, consider failure to make expected weight gains.
- insomnia or hypersomnia nearly every day
- psychomotor agitation or retardation nearly every day (observable by others, not merely subjective feelings of restlessness or being slowed down)
- fatigue or loss of energy nearly every day
- feelings of worthlessness or excessive or inappropriate guilt (which may be delusional) nearly every day (not merely self-reproach or guilt about being sick)
- diminished ability to think or concentrate, or indecisiveness, nearly every day (either by subjective account or as observed by others)
- recurrent thoughts of death (not just fear of dying), recurrent suicidal ideation without a specific plan, or a suicide attempt or a specific plan for committing suicide
- The symptoms do not meet criteria for a Mixed Episode (see p. 335).
- The symptoms cause clinically significant distress or impairment in social, occupational, or other important areas of functioning.
- The symptoms 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., hypothyroidism).
- The symptoms are not better accounted for by Bereavement, i.e., after the loss of a loved one, the symptoms persist for longer than 2 months or are characterized by marked functional impairment, morbid preoccupation with worthlessness, suicidal ideation, psychotic symptoms, or psychomotor retardation.
Diagnostic criteria for 300.4 Dysthymic Disorder
- Depressed mood for most of the day, for more days than not, as indicated either by subjective account or observation by others, for at least 2 years. Note: In children and adolescents, mood can be irritable and duration must be at least 1 year.
- Presence, while depressed, of two (or more) of the following:
- poor appetite or overeating
- insomnia or hypersomnia
- low energy or fatigue
- low self-esteem
- poor concentration or difficulty making decisions
- feelings of hopelessness
- During the 2-year period (1 year for children or adolescents) of the disturbance, the person has never been without the symptoms in Criteria A and B for more than 2 months at a time.
- No Major Depressive Episode (see p. 327) has been present during the first 2 years of the disturbance (1 year for children and adolescents), i.e., the disturbance is not better accounted for by chronic Major Depressive Disorder, or Major Depressive Disorder, In Partial Remission.
Note: There may have been a previous Major Depressive Episode provided there was a full remission (no significant signs or symptoms for 2 months) before development of the Dysthymic Disorder. In addition, after the initial 2 years (1 year in children or adolescents) of Dysthymic Disorder, there may be superimposed episodes of Major Depressive Disorder, in which case both diagnoses may be given when the criteria are met for a Major Depressive Episode.
- There has never been a Manic Episode (see p. 332), a Mixed Episode (see p. 335), or a Hypomanic Episode (see p. 338), and criteria have never been met for Cyclothymic Disorder.
- The disturbance does not occur exclusively during the course of a chronic Psychotic Disorder, such as Schizophrenia or Delusional Disorder.
- The symptoms 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., hypothyroidism).
- The symptoms cause clinically significant distress or impairment in social, occupational, or other important areas of functioning.
Specify if:
Early Onset: if onset is before age 21 years
Late Onset: if onset is age 21 years or older
Specify (for most recent 2 years of Dysthymic Disorder):
With Atypical Features (see p. 384)
Criteria for Atypical Features Specifier
Specify if:
With Atypical Features (can be applied when these features predominate during the most recent 2 weeks of a Major Depressive Episode in Major Depressive Disorder or in Bipolar I or Bipolar II Disorder when the Major Depressive Episodeis the most recent type of mood episode, or when these features predominate during the most recent 2 years of Dysthymic Disorder)
- Mood reactivity (i.e., mood brightens in response to actual or potential positive events)
- Two (or more) of the following features:
- significant weight gain or increase in appetite
- hypersomnia
- leaden paralysis (i.e., heavy, leaden feelings in arms or legs)
- long-standing pattern of interpersonal rejection sensitivity (not limited to episodes of mood disturbance) that results in significant social or occupational impairment
- Criteria are not met for With Melancholic Features or With Catatonic Features during the same episode.
Data Definition
*************************************************************************************
Data Definition ************************************************************************************;
libname sds "&path";
filename discy "&filein";
data sds.ymd0 (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 ('C101') do;
input id $ 1-10
ymd001 16
ymd001a 17
ymd001b 18
ymd001c 19
ymd001d 20
ymd001e 21
ymd001f 22
ymd002 23
ymd002a 24
ymd002b 25
ymd002c 26
ymd003 27
ymd003a 28
ymd003b 29
ymd003c 30
ymd003d 31
ymd003e 32
ymdn01 33
ymdn02 34
ymd004 35
ymd004a 36
ymd004b 37
ymd004c 38
ymd004d 39
ymd004e 40
ymd005 41
ymd005a 42
ymd005b 43
ymd005c 44
ymd006 45
ymd006a 46
ymd006b 47
ymd006c 48
ymd007 49
ymd007a 50
ymd007b 51
ymd007c 52
ymdn03a 53
ymdn03b 54
ymd008 55
ymd008a 56
ymd008b 57
ymd008c 58
ymd008d 59
ymd009 60
ymd009a 61
ymd009b 62
ymd009c 63
ymdn04a 64
ymdn04b 65
ymd010 66
ymd010a 67
ymd010b 68
ymd010c 69
ymd010d 70
ymd011 71
ymd011a 72
ymd011b 73
ymd011c 74
ymd011d 75
ymd011e 76
ymdn05a 77
ymdn05b 78;
end;
when ('C102') do;
input id $ 1-10
ymd012 16
ymd012a 17
ymd012b 18
ymd012c 19
ymd013 20
ymd013a 21
ymd013b 22
ymd013c 23
ymd013d 24
ymdn06a 25
ymdn06b 26
ymd014 27
ymd014a 28
ymd014b 29
ymd014c 30
ymd015 31
ymd015a 32
ymd015b 33
ymd015c 34
ymd015d 35
ymd016 36
ymd016a 37
ymd016b 38
ymd016c 39
ymd016d 40
ymdn07a 41
ymdn07b 42
ymd017 43
ymd017a 44
ymd017b 45
ymd017c 46
ymd018 47
ymd018a 48
ymd018b 49
ymd018c 50
ymd018d 51
ymd019 52
ymd019a 53
ymd019b 54
ymd019c 55
ymd019d 56
ymdn08a 57
ymdn08b 58
ymd020 59
ymd020a 60
ymd020b 61
ymd020c 62
ymd020d 63
ymd021 64
ymd021a 65
ymd021b 66
ymd021c 67
ymd021d 68
ymd021e 69
ymd021f 70;
end;
when ('C103') do;
input id $ 1-10
ymd022 16
ymd022a 17-18
ymd022b 19
ymd022c 20-21
ymd022d 22-23
ymd022e 24
ymd022f 25
ymd022g 26
ymdn09a 27
ymdn09b 28
ymdn10 30
ymd023y 31-32
ymd023z 33-34
ymd023a 35
ymd023b 36
ymd023c 37
ymd023dy 38-39
ymd023dz 40-41
ymd023e 42
ymd024 43
ymd024a 44-45
ymd024b 46-49
ymd024bm 46-47
ymd024by 48-49
ymd024c 50
ymd024d 51
ymd024e 52
ymd024f 53
ymd025 54
ymd025a 55
ymd025b 56
ymd025c 57
ymd025d 58
ymd025e 59
ymd025f 60
ymd025g 61
ymd025h 62
ymd025i 63
ymd025j 64
ymd025k 65
ymd025l 66
ymd025m 67
ymd026 68
ymd026a 69
ymd027 70
ymd027a 71
ymd028 72
ymd028a 73;
end;
when ('C104') do;
input id $ 1-10
ymd029 16
ymd029a 17
ymd030 18
ymd030a 19
ymd031 20
ymd031a 21
ymd032 22
ymd032a 23
ymd033 24-25
ymd033a 26-27
ymd034 28
ymd034ay 29-30
ymd034az 31-32;
end;
when ('C105') do;
input id $ 1-10
ymd035 16
ymd035a 17
ymd035b 18
ymd035c 19
ymd035d 20
ymd035e 21
ymd035f 22
ymd036 23
ymd036a 24
ymd036b 25
ymd036c 26
ymd036d 27
ymd036e 28
ymd037 29
ymd037a 30
ymd038 31
ymd038a 32
ymd039 33
ymd040 34
ymd041 35
ymd041a 36
ymd042 37
ymd042a 38
ymd043 39
ymd044 40
ymd045 41
ymd046 42
ymd047 43
ymd048 44
ymd049 45
ymd050 46
ymd050a 47
ymd051y 48-49
ymd051z 50-51
ymd051a 52
ymd051b 53
ymd051c 54
ymd051dy 55-56
ymd051dz 57-58
ymd051e 59
ymd052 60
ymd052a 61
ymd053 62
ymd053a 63
ymd054 64
ymd054a 65
ymd055 66
ymd055a 67
ymd056 68
ymd056a 69
ymd057 70
ymd057a 71
ymd058 72
ymd058a 73;
end;
when ('C106') do;
input id $ 1-10
ymd059 16-17
ymd059a 18-19
ymd060 20
ymd060a 21
ymd060b 22
ymd060c 23;
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
YMD001 = 'A time in past year when often seemed very upset/depressed'
YMD002 = 'Nothing fun/disinterested in anything/sad in last year'
YMD003 = 'Often grouchy and irritable and little things created anger'
YMD004 = 'Lost weight in last year'
YMD005 = 'Loss in apetite or ate a lot less in last year'
YMD006 = 'Gained a lot of weight in last year'
YMD007 = 'Much hungrier/ate a lot more than usual in last year'
YMD008 = 'Trouble sleeping in last year'
YMD009 = 'Slept more during the day than usual in last year'
YMD010 = 'Seemed to do things like walking/talking much slower in past year'
YMD011 = 'Restless in past year.'
YMD012 = 'Less energy in the last year'
YMD013 = 'Doing even little things was tiring in last year'
YMD014 = 'Arms and legs felt heavy in past year'
YMD015 = 'Blamed self for bad things that happened in past year'
YMD016 = 'Said they couldn''t do anything well/weren''t as pretty/smart as others in past year'
YMD017 = 'Couldn''t think as fast or clearly as usual in past year'
YMD018 = 'Trouble keeping mind on school/other things in past year'
YMD019 = 'Often hard to make decisions in past year'
YMD020 = 'Often thought about death/people dying/being dead in past year'
YMD021 = 'Talked seriously about killing self in past year'
YMD022 = 'Ever in whole life made a suicide attempt'
YMD023y = 'Age when first felt like nothing was fun/interesting.'
YMD023z = 'Grade when first felt like nothing was fun/interesting.'
YMD024 = 'Started acting sad/depressed/nothing fun after death of someone close'
YMD025 = 'Went back and fourth between depression and getting better in past two years'
YMD026 = 'Caretakers became upset/annoyed when problem was at its worst in past year'
YMD027 = 'Being sad/depressed/nothing fun prevented doing things with family'
YMD028 = 'Being sad depressed/nothing fun prevented doing things with peers'
YMD029 = 'When problems were worst they caused difficulty doing schoolwork/bad grades'
YMD030 = 'Being sad/depressed caused teachers/boss to become annoyed with him'
YMD031 = 'Felt bad/upset about saddness/depression'
YMD032 = 'Been to see someone at a hospital/clinic/place of work for help in past year'
YMD033 = 'Name, Position, Address of person seen for help'
YMD034 = 'Ever seemed more grouchy/depressed than now since age of five'
YMD035 = 'Seemed sad or depressed a lot of the time in past year'
YMD036 = 'Grouchy or irritable a lot of the time in past year'
YMD037 = 'Eats more when sad/grouchy/depressed/irritable in past year'
YMD038 = 'Trouble sleeping/waking up when depressed/sad/grouchy/irritable'
YMD039 = 'Has no energy when sad/depressed/grouchy/irritable'
YMD040 = 'Says people don''t like them/they can''d do anything right while sad/depressed/gr'
YMD041 = 'Difficulty paying attention to schoolwork/work when sad/depressed/grouchy/irrit'
YMD042 = 'Feels like life is hopeless/full of despair when sad/depressed/grouchy/irritabl'
YMD043 = 'Tearful/about to cry when sad/depressed/grouchy/irritable'
YMD044 = 'Acts like nothing is fun when sad/depressed/grouchy/irritable, even things usua'
YMD045 = 'Seems bored/disinterested when sad/depressed/grouchy/irritable'
YMD046 = 'Hard to do everyday things when sad/depressed/grouchy/irritable'
YMD047 = 'Talks a lot about bad things that happened in the past when sad/depressed/grouc'
YMD048 = 'Wants to be away from people/alone when sad/depressed/grouchy/irritable'
YMD049 = 'Talks a lot less when sad/depressed/grouchy/irritable'
YMD050 = 'During past 12 months there were times when he/she felt better about things'
YMD051y = 'Age when first 12 months of saddness/depression occurred'
YMD051z = 'Grade when first 12 months of saddness/depression occurred'
YMD052 = 'When problem was worst caretakers became upset/annoyed'
YMD053 = 'Being sad/depressed/grouchy/irritable prevented doing things with family'
YMD054 = 'Being sad/depressed/grouchy/irritable prevented doing things with peers'
YMD055 = 'Being sad/depressed/grouchy/irritable cause problems doing schoolwork/work'
YMD056 = 'Being sad/depressed/grouchy/irritable made teachers/bosses annoyed'
YMD057 = 'Felt bad/upset when problems were worst'
YMD058 = 'Been to see someone at a hospital/clinic/at work for help'
YMD059 = 'Name, position,address of person seen for help'
YMD060 = 'Gets very upset when left out of something';
run;
Data Recoding
*****************************************************************************************
Data Recoding
99, 9, 77, 7 -> missing
88, 8 -> 0 ****************************************************************************************;
data sds.ymd1;
set sds.ymd0;
array ymdvar(*)
ymd001 ymd001a ymd001b ymd001c ymd001d ymd001e ymd001f
ymd002 ymd002a ymd002b ymd002c
ymd003 ymd003a ymd003b ymd003c ymd003d ymd003e
ymd004 ymd004a ymd004b ymd004c ymd004d ymd004e
ymd005 ymd005a ymd005b ymd005c
ymd006 ymd006a ymd006b ymd006c
ymd007 ymd007a ymd007b ymd007c
ymd008 ymd008a ymd008b ymd008c ymd008d
ymd009 ymd009a ymd009b ymd009c
ymd010 ymd010a ymd010b ymd010c ymd010d
ymd011 ymd011a ymd011b ymd011c ymd011d ymd011e
ymd012 ymd012a ymd012b ymd012c
ymd013 ymd013a ymd013b ymd013c ymd013d
ymd014 ymd014a ymd014b ymd014c
ymd015 ymd015a ymd015b ymd015c ymd015d
ymd016 ymd016a ymd016b ymd016c ymd016d
ymd017 ymd017a ymd017b ymd017c
ymd018 ymd018a ymd018b ymd018c ymd018d
ymd019 ymd019a ymd019b ymd019c ymd019d
ymd020 ymd020a ymd020b ymd020c ymd020d
ymd021 ymd021a ymd021b ymd021c ymd021d ymd021e ymd021f
ymd022 ymd022b ymd022e ymd022f ymd022g
ymd023a ymd023b ymd023c ymd023e
ymd024 ymd024c ymd024d ymd024e ymdo24f
ymd025 ymd025a ymd025b ymd025c ymd025d ymd025e ymd025f
ymd025g ymd025h ymd025i ymd025j ymd025k ymd025l ymd025m
ymd032 ymd032a
ymd034
ymd035 ymd035a ymd035b ymd035c ymd035d ymd035e ymd035f
ymd036 ymd036a ymd036b ymd036c ymd036d ymd036e
ymd037 ymd037a
ymd038 ymd038a
ymd039
ymd040
ymd041 ymd041a
ymd042 ymd042a
ymd043
ymd044
ymd045
ymd046
ymd047
ymd048
ymd049
ymd050 ymd050a
ymd051a ymd051b ymd051c ymd051e
ymd058 ymd058a
ymd060 ymd060a ymd060b ymd060c
ymd026 ymd027 ymd028 ymd029 ymd030 ymd031
ymd052 ymd053 ymd054 ymd055 ymd056 ymd057;
do i = 1 to dim(ymdvar);
if (ymdvar(i) = 9 or ymdvar(i) = 7) then ymdvar(i) = .;
end;
array double(*)
ymd022a ymd022c ymd022d
ymd023y ymd023z ymd023dy ymd023dz
ymd024a ymd024bm ymd024by
ymd033 ymd033a
ymd034ay ymd034az
ymd051y ymd051z ymd051dy ymd051dz
ymd059 ymd059a;
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(*)
ymd029
ymd030
ymd031
ymd055
ymd056;
do i = 1 to dim(eight);
if (eight(i) = 8) then eight(i) = 0;
end;
if ymd025b = 9999 or ymd025b = 7777 then ymd025b = .; /* Q25b takes 4 columns */
if ymd025b = 8888 then ymd025b = 0;
run;
Algorithms
*****************************************************************************************
Algorithms ****************************************************************************************;
proc sort data=sds.ymodi1; by id;
proc sort data = sds.yma2; by id;
proc sort data = sds.ysz2; by id;
proc sort data = sds.ymd1; by id;
data sds.ymd2
(keep = id huid ymda1y ymda2y ymda3y ymda4y ymda5y ymda6y ymda7y ymda8y ymda9y
ymday ymda1m ymda2m ymda3m ymda4m ymda5m ymda6m ymda7m ymda8m ymda9m
ymdam ymdey ymdem ymdy ymdm
ydyay ydyam ydyb1 ydyb2 ydyb3 ydyb4 ydyb5 ydyb6 ydybY YDYBM ydyc ydydy ydydm
ydyy ydym
ymdima1 ymdima2 ymdima3 ymdima4 ymdima5 ymdima6 ymdima ymdyima ymdmima
ymdimb ymdyimb ymdmimb
ymdimc1 ymdimc2 ymdimc3 ymdimc4 ymdimc5 ymdimc6 ymdimc ymdyimc ymdmimc
ymdyimd ymdmimd
ydyima1 ydyima2 ydyima3 ydyima4 ydyima5 ydyima6 ydyima ydyyima ydymima
ydyimb ydyyimb ydymimb
ydyimc1 ydyimc2 ydyimc3 ydyimc4 ydyimc5 ydyimc6 ydyimc ydyyimc ydymimc ydyyimd ydymimd
ymdcrity ymdcritm ydycrity ydycritm ymdsymp
ymd001-ymd021 ymd022b ymd028a ymd028 ymd026 ymd026a ymd027 ymd027a
ymdyimd ymdmimd );
merge sds.ymd1 sds.ysz2 sds.yma2 sds.ymodi1; by id;
if ymdn10=0 then do;
array p1(*) ymd024-ymd034;
do i=1 to dim(p1);
p1[i]=0;
end;
end;
if sum((ymd002b=2), (ymdn02=2), (ymdn03b=2), (ymdn04b=2),
(ymdn05b=2), (ymdn06b=2), (ymdn07b=2), (ymdn08b=2),
(ymdn09b=2))>=5 then do;
array p2(*) ymd035-ymd059;
do i=1 to dim(p2);
p2[i]=0;
end;
end;
if ymd035b=2 then ymd036=0;
if sum( (ymd035b=2), (ymd036b=2))=0 and n(ymd035,ymd036)>0 then do;
array aa{*} ymd037-ymd049 YMD037A YMD038A YMD041A YMD042A;
do i=1 to dim(aa);
aa[i]=0;
end;
end;
if (sum( (ymd035b=2), (ymd036b=2))=0 and n(ymd035,ymd036)>0) OR
(sum( (1<=ymd037<=2), (1<=ymd037a<=2),
(1<=ymd038<=2), (1<=ymd038a<=2),
(1<=ymd039<=2),
(1<=ymd040<=2),
(1<=ymd041<=2), (1<=ymd041a<=2),
(1<=ymd042<=2), (1<=ymd042a<=2),
(1<=ymd043<=2),
(1<=ymd044<=2),
(1<=ymd045<=2),
(1<=ymd046<=2),
(1<=ymd047<=2),
(1<=ymd048<=2),
(1<=ymd049<=2))=0 and n(of ymd037-ymd049)>0) then do;
array bb(*) ymd050-ymd058 ymd060;
do i=1 to dim(bb);
bb[i]=0;
end;
end;
if ymd050a=2 then do;
array cc(*) ymd051-ymd058 ymd060;
do i=1 to dim(cc);
cc[i]=0;
end;
end;
array impair(6) ymd026 ymd027 ymd028 ymd029 ymd030 ymd031;
array impaira(6) ymd026a ymd027a ymd028a ymd029a ymd030a ymd031a;
do i=1 to 6;
if impair[i]=0 then impaira[i]=1;
end;
array impaid(6) ymd052 ymd053 ymd054 ymd055 ymd056 ymd057;
array impaida(6) ymd052a ymd053a ymd054a ymd055a ymd056a ymd057a;
do i=1 to 6;
if impaid[i]=0 then impaida[i]=1;
end;
****** Criteria for Major Depressive Disorder ******;
*-----A;
*-----Past Year;
*-----A1;
if (ymd001d = 2 or ymd003d = 2) then ymda1y = 1;
else if ((ymd001 = 0 or ymd001a = 0 or ymd001c = 0 or ymd001d = 0) and
(ymd003 = 0 or ymd003a = 0 or ymd003c = 0 or ymd003d = 0)) then ymda1y = 0;
*-----A2;
if (ymd002b = 2) then ymda2y = 1;
else if (ymd002 = 0 or ymd002a = 0 or ymd002b = 0) then ymda2y = 0;
IF (YMDA1Y = 1 OR YMDA2Y = 1) THEN DO;
*-----A3;
if (ymd004d = 2 or ymd005b = 2 or ymd006b = 2 or ymd007b = 2) then ymda3y = 1;
else if ((ymd004 = 0 or (ymd004a = 2 and ymd004b = 0) or ymd004d = 0)
AND (ymd005 = 0 or ymd005a = 0 or ymd005b = 0)
AND (ymd006 = 0 or ymd006b = 0)
AND (ymd007 = 0 or ymd007a = 0 or ymd007b = 0)) then ymda3y = 0;
*-----A4;
if ((ymd008a = 2 and ymd008c = 2) or ymd009b = 2) then ymda4y = 1;
else if ((ymd008 = 0 or ymd008a = 0 or ymd008b = 0 or ymd008c = 0) AND
(ymd009 = 0 or ymd009a = 0 or ymd009b = 0)) then ymda4y = 0;
*-----A5;
if ((ymd010a = 2 and ymd010c = 2) or (ymd011a = 2 and ymd011b = 2 and ymd011d = 2))
then ymda5y = 1;
else if ((ymd010 = 0 or ymd010a = 0 or ymd010b = 0 or ymd010c = 0)
AND (ymd011 = 0 or ymd011a = 0 or ymd011b = 0 or ymd011c = 0 or ymd011d = 0))
then ymda5y = 0;
*-----A6;
if (ymd012b = 2 or (ymd013a = 2 and ymd013c = 2)) then ymda6y = 1;
else if ((ymd012 = 0 or ymd012a = 0 or ymd012b = 0)
AND (ymd013 = 0 or ymd013a = 0 or ymd013b = 0 or ymd013c = 0)) then ymda6y = 0;
*-----A7;
if ((ymd015a = 2 and ymd015c = 2) or (ymd016a = 2 and ymd016c = 2))
then ymda7y = 1;
else if ((ymd015 = 0 or ymd015a = 0 or ymd015b = 0 or ymd015c = 0)
AND (ymd016 = 0 or ymd016a = 0 or ymd016b = 0 or ymd016c = 0)) then ymda7y = 0;
*-----A8;
if (ymd017b = 2 or (ymd018a = 2 and ymd018c = 2) or (ymd019a = 2 and ymd019c = 2))
then ymda8y = 1;
else if ((ymd017 = 0 or ymd017a = 0 or ymd017b = 0)
AND (ymd018 = 0 or ymd018a = 0 or ymd018b = 0 or ymd018c = 0)
AND (ymd019 = 0 or ymd019a = 0 or ymd019b = 0 or ymd019c = 0)) then ymda8y = 0;
*-----A9;
if ((ymd020a = 2 and ymd020b = 2) or ((ymd021a = 2 or ymd021b = 2) and ymd021c = 2)
or ymd022f = 2) then ymda9y = 1;
else if ((ymd020 = 0 or ymd020a = 0 or ymd020b = 0)
AND (ymd021 = 0 or (ymd021a = 0 and ymd021b = 0) or ymd021c = 0)
AND (ymd022 = 0 or ymd022f = 0)) then ymda9y = 0;
END;
ELSE IF (YMDA1Y = 0 AND YMDA2Y = 0) THEN DO;
YMDA3Y = 0; YMDA4Y = 0; YMDA5Y = 0; YMDA6Y = 0; YMDA7Y = 0; YMDA8Y = 0; YMDA9Y = 0;
END;
sumy = sum(of ymda1y ymda2y ymda3y ymda4y ymda5y ymda6y ymda7y ymda8y ymda9y);
ny = n(of ymda1y ymda2y ymda3y ymda4y ymda5y ymda6y ymda7y ymda8y ymda9y);
zeroy = ny - sumy;
if (sumy ge 5) then ymday = 1;
else if (zeroy ge 5) then ymday = 0;
*--------Past Month;
*-----A1;
if (ymd001d = 2 and ymd001f = 2) or (ymd003d = 2 and ymd003e = 2) then ymda1m = 1;
else if ((ymd001 = 0 or ymd001a = 0 or ymd001c = 0 or ymd001d = 0 or ymd001f = 0)
AND (ymd003 = 0 or ymd003a = 0 or ymd003c = 0 or ymd003d = 0 or ymd003e = 0))
then ymda1m = 0;
*-----A2;
if (ymd002b = 2 and ymd002c = 2) then ymda2m = 1;
else if (ymd002 = 0 or ymd002a = 0 or ymd002b = 0 or ymd002c = 0) then ymda2m = 0;
IF (YMDA1M = 1 OR YMDA2M = 1) THEN DO;
*-----A3;
if ((ymd004d = 2 and ymd004e = 2) or (ymd005b = 2 and ymd005c = 2) or
(ymd006b = 2 and ymd006c = 2) or (ymd007b = 2 and ymd007c = 2)) then ymda3m = 1;
else if ((ymd004 = 0 or ymd004b = 0 or ymd004d = 0 or ymd004e = 0)
AND (ymd005 = 0 or ymd005a = 0 or ymd005b = 0 or ymd005c = 0)
AND (ymd006 = 0 or ymd006b = 0 or ymd006c = 0)
AND (ymd007 = 0 or ymd007a = 0 or ymd007b = 0 or ymd007c = 0)) then ymda3m = 0;
*-----A4;
if ((ymd008a = 2 and ymd008c = 2 and ymd008d = 2) or (ymd009b = 2 and ymd009c = 2))
then ymda4m = 1;
else if ((ymd008 = 0 or ymd008a = 0 or ymd008b = 0 or ymd008c = 0 or ymd008d = 0)
AND (ymd009 = 0 or ymd009a = 0 or ymd009b = 0 or ymd009c = 0)) then ymda4m = 0;
*-----A5;
if ((ymd010a = 2 and ymd010c = 2 and ymd010d = 2) or (ymd011a = 2 and ymd011b = 2
and ymd011d = 2 and ymd011e = 2)) then ymda5m = 1;
else if ((ymd010 = 0 or ymd010a = 0 or ymd010b = 0 or ymd010c = 0 or ymd010d = 0)
AND (ymd011 = 0 or ymd011a = 0 or ymd011b = 0 or ymd011c = 0 or ymd011d = 0 or
ymd011e = 0)) then ymda5m = 0;
*-----A6;
if ((ymd012b = 2 and ymd012c = 2) or (ymd013a = 2 and ymd013c = 2 and ymd013d = 2))
then ymda6m = 1;
else if ((ymd012 = 0 or ymd012a = 0 or ymd012b = 0 or ymd012c = 0)
AND (ymd013 = 0 or ymd013a = 0 or ymd013b = 0 or ymd013c = 0 or ymd013d = 0))
then ymda6m = 0;
*-----A7;
if ((ymd015a = 2 and ymd015c = 2 and ymd015d = 2) or (ymd016a = 2 and ymd016c = 2
and ymd016d = 2)) then ymda7m = 1;
else if ((ymd015 = 0 or ymd015a = 0 or ymd015b = 0 or ymd015c = 0 or ymd015d = 0)
AND (ymd016 = 0 or ymd016a = 0 or ymd016b = 0 or ymd016c = 0 or ymd016d = 0))
then ymda7m = 0;
*-----A8;
if ((ymd017b = 2 and ymd017c = 2) or (ymd018a = 2 and ymd018c = 2 and ymd018d = 2)
or (ymd019a = 2 and ymd019c = 2 and ymd019d = 2)) then ymda8m = 1;
else if ((ymd017 = 0 or ymd017a = 0 or ymd017b = 0 or ymd017c = 0)
AND (ymd018 = 0 or ymd018a = 0 or ymd018b = 0 or ymd018c = 0 or ymd018d = 0)
AND (ymd019 = 0 or ymd019a = 0 or ymd019b = 0 or ymd019c = 0 or ymd019d = 0))
then ymda8m = 0;
*-----A9;
if ((ymd020a = 2 and ymd020b = 2 and ymd020d = 2) or ((ymd021a = 2 or ymd021b = 2)
and ymd021c = 2 and ymd021d = 2) or (ymd022f = 2 and ymd022g = 2)) then ymda9m = 1;
else if ((ymd020 = 0 or ymd020a = 0 or ymd020b = 0 or ymd020d = 0)
AND (ymd021 = 0 or (ymd021a = 0 and ymd021b = 0) or ymd021c = 0 or ymd021d = 0)
AND (ymd022 = 0 or ymd022f = 0 or ymd022g = 0)) then ymda9m = 0;
END;
ELSE IF (YMDA1M = 0 AND YMDA2M = 0) THEN DO;
YMDA3M = 0; YMDA4M = 0; YMDA5M = 0; YMDA6M = 0; YMDA7M = 0; YMDA8M = 0; YMDA9M = 0;
END;
summ = sum(of ymda1m ymda2m ymda3m ymda4m ymda5m ymda6m ymda7m ymda8m ymda9m);
nm = n(of ymda1m ymda2m ymda3m ymda4m ymda5m ymda6m ymda7m ymda8m ymda9m);
zerom = nm - summ;
if (summ ge 5) then ymdam = 1;
else if (zerom ge 5) then ymdam = 0;
*-----B; /* Not Covered */
*-----C; /* Not Covered */
*-----D; /* Not Covered */
*-----E;
*----A; /* One intermediate rating of impairment or distress */
if ymd026a = 2 or ymd026a = 3 then ymdima1 = 1;
else if ymd026a = 1 or ymd026a = 7 or ymd026a = 9 then ymdima1 = 0;
if ymd027a = 2 or ymd027a = 3 then ymdima2 = 1;
else if ymd027a = 1 or ymd027a = 7 or ymd027a = 9 then ymdima2 = 0;
if ymd028a = 2 or ymd028a = 3 then ymdima3 = 1;
else if ymd028a = 1 or ymd028a = 7 or ymd028a = 9 then ymdima3 = 0;
if ymd029a = 2 or ymd029a = 3 then ymdima4 = 1;
else if ymd029a = 1 or ymd029a = 7 or ymd029a = 9 then ymdima4 = 0;
if ymd030a = 2 or ymd030a = 3 then ymdima5 = 1;
else if ymd030a = 1 or ymd030a = 7 or ymd030a = 9 then ymdima5 = 0;
if ymd031a = 2 or ymd031a = 3 then ymdima6 = 1;
else if ymd031a = 1 or ymd031a = 7 or ymd031a = 9 then ymdima6 = 0;
if (sum(ymdima1, ymdima2, ymdima3, ymdima4, ymdima5, ymdima6) ge 1)
then ymdima = 1;
else if ((n(ymdima1, ymdima2, ymdima3, ymdima4, ymdima5, ymdima6) - sum(ymdima1,
ymdima2, ymdima3, ymdima4, ymdima5, ymdima6)) ge 6) then ymdima = 0;
if (ymd024 = 0 or ymd024c = 2) or
(ymd015a = 2 and ymd015b = 2 and ymd015c =2) or
(ymd016a = 2 and ymd016b = 2 and ymd016c = 2) or
((ymd021a = 2 or ymd021b = 2) and ymd021c = 2) or
(ymd022b = 2) or (ymdima = 1) or
(ymd010a = 2 and ymd010b = 2 and ymd010c = 2)
then do; ymdey = 1; ymdem = 1; end;
else if (ymd024 = 2 and ymd024c = 0) AND
(ymd015 = 0 or ymd015a = 0 or ymd015b = 0 or ymd015c = 0) AND
(ymd016 = 0 or ymd016a = 0 or ymd016b = 0 or ymd016c = 0) AND
((ymd021 = 0 or (ymd021a = 0 and ymd021b = 0)) or ymd021c = 0) AND
(ymd022 = 0 or ymd022b = 0) AND
(ymd010 = 0 or ymd010a = 0 or ymd010b = 0 or ymd010c = 0)
then do; ymdey = 0; ymdem = 0; end;
****** Diagnosis for MDD ******;
if (ymday = 1 and ymdey = 1) then ymdy = 1;
else if (ymday = 0 or ymdey = 0) then ymdy = 0;
if (ymdam = 1 and ymdem = 1) then ymdm = 1;
else if (ymdam = 0 or ymdem = 0) then ymdm = 0;
****** Variable Labels ******;
label ymday = 'Five symptoms same 2-week period'
ymda1y = 'Depressed mood or irritable mood'
ymda2y = 'Diminished interest or pleasure'
ymda3y = 'Weight loss or weight gain or appetite change'
ymda4y = 'Insomnia or hypersomnia'
ymda5y = 'Psychomotor agitation or retardation'
ymda6y = 'Fatigue or loss of energy'
ymda7y = 'Worthlessness or guilt'
ymda8y = 'Thinking or concentration problems or indecisiveness'
ymda9y = 'Thoughts of death, suicidal ideation, suicide attempt or plan'
ymdey = 'Not due to Bereavement'
ymdy = 'Past Year: diagnosis for major depression disorder'
ymda1m = 'Depressed mood or irritable mood'
ymda2m = 'Diminished interest or pleasure'
ymda3m = 'Weight loss or weight gain or appetite change'
ymda4m = 'Insomnia or hypersomnia'
ymda5m = 'Psychomotor agitation or retardation'
ymda6m = 'Fatigue or loss of energy'
ymda7m = 'Worthlessness or guilt'
ymda8m = 'Thinking or concentration problems or indecisiveness'
ymda9m = 'Thoughts of death, suicidal ideation, suicide attempt or plan'
ymdem = 'Not due to Bereavement'
ymdm = 'Past month: diagnosis for major depression disorder';
****** Criteria for Dysthymic Disorder ******;
*-----A;
*-----Past Year;
if ((ymd035b = 2 and ymd035d = 2) or (ymd036b = 2 and ymd036d = 2)) then ydyay = 1;
else if ((ymd035 = 0 or ymd035a = 0 or ymd035b = 0 or ymd035d = 0) and (ymd036 = 0
or ymd036a = 0 or ymd036b = 0 or ymd036d = 0)) then ydyay = 0;
*-----Past Month;
if ((ymd035b = 2 and ymd035d = 2 and ymd035f = 2) or (ymd036b = 2 and ymd036d = 2 and
ymd036e = 2)) then ydyam = 1;
else if ((ymd035 = 0 or ymd035a = 0 or ymd035b = 0 or ymd035d = 0 or ymd035f = 0) and
(ymd036 = 0 or ymd036a = 0 or ymd036b = 0 or ymd036d = 0 or ymd036e = 0))
then ydyam = 0;
/* FOR THE FOLLOWING CRITERIA, ALGORITHM IS THE SAME FOR YEAR AND MONTH */
*----B;
*-----B1;
if ((1<=ymd037<=2) or (1<=ymd037a<=2)) then ydyb1 = 1;
else if (ymd037 = 0 AND YMD037A=0) then ydyb1 = 0;
*-----B2;
if ((1<=ymd038<=2) or (1<=ymd038a<=2)) then ydyb2 = 1;
else if (ymd038 = 0 AND YMD038A=0) then ydyb2 = 0;
*-----B3;
if (1<=ymd039<=2) then ydyb3 = 1;
else if (ymd039 = 0) then ydyb3 = 0;
*-----B4;
if (1<=ymd040<=2) then ydyb4 = 1;
else if (ymd040 = 0) then ydyb4 = 0;
*-----B5;
if ((1<=ymd041<=2) or (1<=ymd041a<=2)) then ydyb5 = 1;
else if (ymd041 = 0 AND YMD041A=0) then ydyb5 = 0;
*-----B6;
if ((1<=ymd042<=2) or (1<=ymd042a<=2)) then ydyb6 = 1;
else if (ymd042 = 0 AND YMD042A=0) then ydyb6 = 0;
if (sum(of ydyb1-ydyb6) ge 2) and ydyay = 1 then ydyby = 1;
else if ((n(of ydyb1-ydyb6) - sum(of ydyb1-ydyb6)) ge 5) or Ydyay = 0 then ydyby = 0;
if (sum(of ydyb1-ydyb6) ge 2) and ydyam = 1 then ydybm = 1;
else if ((n(of ydyb1-ydyb6) - sum(of ydyb1-ydyb6)) ge 5) or Ydyam = 0 then ydybm = 0;
*-----C;
if (ymd050 = 0 or ymd050a = 0) then ydyc = 1;
else if (ymd050 = 2 and ymd050a = 2) then ydyc = 0;
*-----D; /* MDD = NO */
if ymdy = 0 then ydydy = 1;
else if ymdy = 1 then ydydy = 0;
if ymdm = 0 then ydydm = 1;
else if ymdm = 0 then ydydm = 0;
*-----E; /* not covered */
*-----F; /* not covered */
****** Diagnosis for DD ******;
if (ydyay = 1 and ydyby = 1 and ydyc = 1 and ydydy = 1 ) then ydyy = 1;
else if (ydyay = 0 or ydyby = 0 or ydyc = 0 or ydydy = 0 ) then ydyy = 0;
if (ydyam = 1 and ydybm = 1 and ydyc = 1 and ydydm = 1 ) then ydym = 1;
else if (ydyam = 0 or ydybm = 0 or ydyc = 0 or ydydm = 0 ) then ydym = 0;
****** Variable Labels ******;
label ydyay = 'Depressed mood or irritable mood'
ydyby = 'Two symptoms when depressed'
ydybm = 'Two symptoms when depressed'
ydyb1 = 'Poor appetite or overeating'
ydyb2 = 'Insomnia or hypersomnia'
ydyb3 = 'Low energy or fatigue'
ydyb4 = 'Low self-esteem'
ydyb5 = 'Poor concentration or difficulty making decisions'
ydyb6 = 'Feelings of hopelessness'
ydyc = 'Never without symptoms for more than 2 months'
ydydy = 'Not major depression'
ydyy = 'Diagnosis for dysthymic disorder';
*------ IMPAIRMENT ALGORITHMS; /* For MDD */
*----A; /* One intermediate rating of impairment or distress */
if ymd026a = 2 or ymd026a = 3 then ymdima1 = 1;
else if ymd026a = 1 or ymd026a = 7 or ymd026a = 9 then ymdima1 = 0;
if ymd027a = 2 or ymd027a = 3 then ymdima2 = 1;
else if ymd027a = 1 or ymd027a = 7 or ymd027a = 9 then ymdima2 = 0;
if ymd028a = 2 or ymd028a = 3 then ymdima3 = 1;
else if ymd028a = 1 or ymd028a = 7 or ymd028a = 9 then ymdima3 = 0;
if ymd029a = 2 or ymd029a = 3 then ymdima4 = 1;
else if ymd029a = 1 or ymd029a = 7 or ymd029a = 9 then ymdima4 = 0;
if ymd030a = 2 or ymd030a = 3 then ymdima5 = 1;
else if ymd030a = 1 or ymd030a = 7 or ymd030a = 9 then ymdima5 = 0;
if ymd031a = 2 or ymd031a = 3 then ymdima6 = 1;
else if ymd031a = 1 or ymd031a = 7 or ymd031a = 9 then ymdima6 = 0;
if (sum(ymdima1, ymdima2, ymdima3, ymdima4, ymdima5, ymdima6) ge 1)
then ymdima = 1;
else if ((n(ymdima1, ymdima2, ymdima3, ymdima4, ymdima5, ymdima6) - sum(ymdima1,
ymdima2, ymdima3, ymdima4, ymdima5, ymdima6)) ge 6) then ymdima = 0;
if (ymdy = 1 and ymdima = 1) then ymdyima = 1;
else if (ymdy = 0 or ymdima = 0) then ymdyima = 0;
if (ymdm = 1 and ymdima = 1) then ymdmima = 1;
else if (ymdm = 0 or ymdima = 0) then ymdmima = 0;
*------B; /* Two intermediate ratings of impairment or distress */
if (sum(ymdima1, ymdima2, ymdima3, ymdima4, ymdima5, ymdima6) ge 2)
then ymdimb = 1;
else if ((n(ymdima1, ymdima2, ymdima3, ymdima4, ymdima5, ymdima6) - sum(ymdima1,
ymdima2, ymdima3, ymdima4, ymdima5, ymdima6)) ge 5) then ymdimb = 0;
if (ymdy = 1 and ymdimb = 1) then ymdyimb = 1;
else if (ymdy = 0 or ymdimb = 0) then ymdyimb = 0;
if (ymdm = 1 and ymdimb = 1) then ymdmimb = 1;
else if (ymdm = 0 or ymdimb = 0) then ymdmimb = 0;
*-----C; /* One severe rating of impairment or distress */
if ymd026a = 3 then ymdimc1 = 1;
else if ymd026a = 1 or ymd026a = 2 or ymd026a = 7 or ymd026a = 9 then ymdimc1 = 0;
if ymd027a = 3 then ymdimc2 = 1;
else if ymd027a = 1 or ymd027a = 2 or ymd027a = 7 or ymd027a = 9 then ymdimc2 = 0;
if ymd028a = 3 then ymdimc3 = 1;
else if ymd028a = 1 or ymd028a = 2 or ymd028a = 7 or ymd028a = 9 then ymdimc3 = 0;
if ymd029a = 3 then ymdimc4 = 1;
else if ymd029a = 1 or ymd029a = 2 or ymd029a = 7 or ymd029a = 9 then ymdimc4 = 0;
if ymd030a = 3 then ymdimc5 = 1;
else if ymd030a = 1 or ymd030a = 2 or ymd030a = 7 or ymd030a = 9 then ymdimc5 = 0;
if ymd031a = 3 then ymdimc6 = 1;
else if ymd031a = 1 or ymd031a = 2 or ymd031a = 7 or ymd031a = 9 then ymdimc6 = 0;
if (sum(ymdimc1, ymdimc2, ymdimc3, ymdimc4, ymdimc5, ymdimc6) ge 1)
then ymdimc = 1;
else if ((n(ymdimc1, ymdimc2, ymdimc3, ymdimc4, ymdimc5, ymdimc6) - sum(ymdimc1,
ymdimc2, ymdimc3, ymdimc4, ymdimc5, ymdimc6)) ge 6) then ymdimc = 0;
if ymdy = 1 and ymdimc = 1 then ymdyimc = 1;
else if ymdy = 0 or ymdimc = 0 then ymdyimc = 0;
if ymdm = 1 and ymdimc = 1 then ymdmimc = 1;
else if ymdm = 0 or ymdimc = 0 then ymdmimc = 0;
*------D; /* Impairment D: present when impairment B or C are satisified */
If ymdyimb = 1 or ymdyimc = 1 then ymdyimd = 1;
else if ymdyimb = 0 and ymdyimc = 0 then ymdyimd = 0;
If ymdmimb = 1 or ymdmimc = 1 then ymdmimd = 1;
else if ymdmimb = 0 and ymdmimc = 0 then ymdmimd = 0;
*******------ IMPAIRMENT ALGORITHMS; /* For DD */
*----A; /* One intermediate rating of impairment or distress */
if ymd052a = 2 or ymd052a = 3 then ydyima1 = 1;
else if ymd052a = 1 or ymd052a = 7 or ymd052a = 9 then ydyima1 = 0;
if ymd053a = 2 or ymd053a = 3 then ydyima2 = 1;
else if ymd053a = 1 or ymd053a = 7 or ymd053a = 9 then ydyima2 = 0;
if ymd054a = 2 or ymd054a = 3 then ydyima3 = 1;
else if ymd054a = 1 or ymd054a = 7 or ymd054a = 9 then ydyima3 = 0;
if ymd055a = 2 or ymd055a = 3 then ydyima4 = 1;
else if ymd055a = 1 or ymd055a = 7 or ymd055a = 9 then ydyima4 = 0;
if ymd056a = 2 or ymd056a = 3 then ydyima5 = 1;
else if ymd056a = 1 or ymd056a = 7 or ymd056a = 9 then ydyima5 = 0;
if ymd057a = 2 or ymd057a = 3 then ydyima6 = 1;
else if ymd057a = 1 or ymd057a = 7 or ymd057a = 9 then ydyima6 = 0;
if (sum(ydyima1, ydyima2, ydyima3, ydyima4, ydyima5, ydyima6) ge 1) or ymdima=1
then ydyima = 1;
else if ((n(ydyima1, ydyima2, ydyima3, ydyima4, ydyima5, ydyima6) - sum(ydyima1,
ydyima2, ydyima3, ydyima4, ydyima5, ydyima6)) ge 6) and ymdima=0 then ydyima = 0;
if ydyy = 1 and ydyima = 1 then ydyyima = 1;
else if ydyy = 0 or ydyima = 0 then ydyyima = 0;
if ydym = 1 and ydyima = 1 then ydymima = 1;
else if ydym = 0 or ydyima = 0 then ydymima = 0;
*------B; /* Two intermediate ratings of impairment or distress */
if (sum(ydyima1, ydyima2, ydyima3, ydyima4, ydyima5, ydyima6) ge 2) or ymdimb=1
then ydyimb = 1;
else if ((n(ydyima1, ydyima2, ydyima3, ydyima4, ydyima5, ydyima6) - sum(ydyima1,
ydyima2, ydyima3, ydyima4, ydyima5, ydyima6)) ge 5) and ymdimb=0 then ydyimb = 0;
if ydyy = 1 and ydyimb = 1 then ydyyimb = 1;
else if ydyy = 0 or ydyimb = 0 then ydyyimb = 0;
if ydym = 1 and ydyimb = 1 then ydymimb = 1;
else if ydym = 0 or ydyimb = 0 then ydymimb = 0;
*-----C; /* One severe rating of impairment or distress */
if ymd052a = 3 then ydyimc1 = 1;
else if ymd052a = 1 or ymd052a = 2 or ymd052a = 7 or ymd052a = 9 then ydyimc1 = 0;
if ymd053a = 3 then ydyimc2 = 1;
else if ymd053a = 1 or ymd053a = 2 or ymd053a = 7 or ymd053a = 9 then ydyimc2 = 0;
if ymd054a = 3 then ydyimc3 = 1;
else if ymd054a = 1 or ymd054a = 2 or ymd054a = 7 or ymd054a = 9 then ydyimc3 = 0;
if ymd055a = 3 then ydyimc4 = 1;
else if ymd055a = 1 or ymd055a = 2 or ymd055a = 7 or ymd055a = 9 then ydyimc4 = 0;
if ymd056a = 3 then ydyimc5 = 1;
else if ymd056a = 1 or ymd056a = 2 or ymd056a = 7 or ymd056a = 9 then ydyimc5 = 0;
if ymd057a = 3 then ydyimc6 = 1;
else if ymd057a = 1 or ymd057a = 2 or ymd057a = 7 or ymd057a = 9 then ydyimc6 = 0;
if (sum(ydyimc1, ydyimc2, ydyimc3, ydyimc4, ydyimc5, ydyimc6) ge 1) or ymdimc=1
then ydyimc = 1;
else if ((n(ydyimc1, ydyimc2, ydyimc3, ydyimc4, ydyimc5, ydyimc6) - sum(ydyimc1,
ydyimc2, ydyimc3, ydyimc4, ydyimc5, ydyimc6)) ge 6) and ymdimc=0 then ydyimc = 0;
if ydyy = 1 and ydyimc = 1 then ydyyimc = 1;
else if ydyy = 0 or ydyimc = 0 then ydyyimc = 0;
if ydym = 1 and ydyimc = 1 then ydymimc = 1;
else if ydym = 0 or ydyimc = 0 then ydymimc = 0;
*------D; /* Impairment D: present when impairment B or C are satisified */
If ydyyimb = 1 or ydyyimc = 1 then ydyyimd = 1;
else if ydyyimb = 0 and ydyyimc = 0 then ydyyimd = 0;
If ydymimb = 1 or ydymimc = 1 then ydymimd = 1;
else if ydymimb = 0 and ydymimc = 0 then ydymimd = 0;
***** Criterion Count*****;
ymdcrity=sum(of ymda1y ymda2y ymda3y ymda4y ymda5y ymda6y ymda7y ymda8y ymda9y );
ymdcritm=sum(of ymda1m ymda2m ymda3m ymda4m ymda5m ymda6m ymda7m ymda8m ymda9m );
ydycrity=sum(of ydyay ydyb1 ydyb2 ydyb3 ydyb4 ydyb5 ydyb6);
ydycritm=sum(of ydyam ydyb1 ydyb2 ydyb3 ydyb4 ydyb5 ydyb6);
*****Symptom Count *******;
if ymd022=0 then ymd022b=0;
ymdsymp=sum(of ymd001-ymd021 ymd022b)/2;
label
ymdcrity = 'Youth Major Depressive Disorder Criteria Count - Past Year'
ymdcritm = 'Youth Major Depressive Disorder Criteria Count - Past Month'
ydycrity = 'Youth Dysthymia Criteria Count - Past Year'
ydycritm = 'Youth Dysthymia Criteria Count - Past Month'
ymdsymp = 'Youth Major Depressive Disorder Symptom Count';
run;