# Compute Groups for Patient Health Questionnaire 9 (PHQ-9)

#### Mukgtine

##### New Member
Hello all,

This questionnaire is used to assess depression. There are 9 questions, each scored as 0, 1, 2, or 3 (severity). Here are the scoring instructions, I want to know how to write the syntax to compute the groups:

Major depression is suggested if questions #1 or #2, and five or more of questions #1-#9 are scored as 2 or 3.

Other depression is suggested if questions #1 or #2, and two, three, or four of questions #1-#9 are scored as 2 or 3.

Anyone who isn't in the above two groups would be considered to have no/minimal depression.

Mike

#### Karabiner

##### TS Contributor
Duplicate your 9 questions and recode them (0 or 1 = 0 and 2 or 3 = 1).

Then, for example:

Other depression is suggested if questions #1 or #2, and two, three, or four of questions #1-#9 are scored as 2 or 3.
IF( ((q1 =1) OR (q2 = 1)) AND (SUM(q1 to q9) > 1) AND (SUM(q1 to q9) < 5) )
depression = 2 .

HTH

K.

#### Mukgtine

##### New Member

I recoded the 9 questions so that they have scores of 0 or 1, but I don't know the syntax for computing a new variable with IF statements. So if this variable will be called PHQ9Groups, with 1 = No/Minimal Depression, 2 = Other Depression, 3 = Major Depression, what do I type?

Thanks again!

#### Karabiner

##### TS Contributor
I don't know the syntax for computing a new variable with IF statements.
In my example, a new variable "depression" was computed using IF ?!
You could call it "PHQ9Groups" instead, if you wish. You can calculate
the 2 other levels accordingly.