cesd Algorithm

All "don't know" and "refused" are converted to null = missing.
All 10 items must be answered to compute the CES-D score.

Q1md, q2md, q3md, q5md, q6md, q8md, q9md, and q10md each count for 1 point when the answer is 'yes' , whereas q4md and q7md count for 1 point when the answer is 'no'.

if (q1md, q2md, q3md, q4md, q5md, q6md, q7md, q8md, q9md, q10md) in (1 2) {
      cesdsum = (q1md=1) + (q2md=1) + (q3md=1) + (q4md=2) + (q5md=1) + (q6md=1) + (q7md=2) + (q8md=1) + (q9md=1) + (q10md=1);
      }


Each logical truth adds +1.
Reference: McDowell, I., Newell, C. (1996). Measuring Health: A Guide to Rating Scales and Questionnaires. (2nd. ed.). Oxford:NY Radloff LS. The CES-D scale: A self-report depression scale for research in the general population. Applied Psychological Measurement 1977;1:385-340.