Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • PHQ in Stata

    Hi, I am new in STATA,

    I have a data set.

    I used PHQ-2 questionnaires. The PHQ-2 comprises two questions (vaiables: phq1 and phq2) concerning the frequency with which the participant experienced different depressive symptoms over the preceding fortnight. Responses to each are coded as 0 ‘not at all’, 1 ‘several days’, 2 ‘more than half the days’, 3 ‘nearly every day’.

    How I can create a summary variable that ranges from 0-6?
    How I can create a cut-off >=3?

    Please, help me!
    Thank you in advance.
    Tanya

  • #2
    please read the FAQ so you better understand how to ask questions and what info to provide people who might try and help you

    here, I assume that each observation has each of the 2 variables and that you want to sum them:
    Code:
    egen byte newvar=rowtotal(phq1 phq2)
    not sure what you mean by a cut-off >=3; do you mean you want an indicator variable that is 0 if the sum is less than 3 and is 1 if the sum is at least 3?
    Code:
    gen byte newvar2 = newvar>=3
    note that I have ignored the possibility of missing values here and you don't say what you want in that case; note that the -egen- command above treats missing as 0; is that what you want; note also that, in Stata, a missing value is the largest possible value so that in the -gen- command, newvar2 will be 1 if newvar is missing; you can rectify that last one easily
    Code:
    replace newvar2=. if newvar==.

    Comment

    Working...
    X