Announcement

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

  • Generating hypertension (hyp) variable using systolic and diastolic blood pressures

    I will like to create a hypertension (hyp) variable using the averages of three systolic (sbp) ie sbp1, sbp2, sbp3 and three diastolic (dbp) ie dbp1, dbp2, dbp3 blood pressures into a binary outcome (0= “no”, 1= “yes”). Where hypertension is defined as meansbp=>140 and meandbp=>90. How do I go about this process? How do I ensure that missing values are not represented as large values in Stata?

    I will appreciate help from anyone familiar with the Demographic and Health Surveys (DHS) and or the World Health Organization’s Study on Adult Health and Global Ageing (SAGE). I’m also open for help from experts in Stata in general

    I will appreciate your timely response.

    Emmanuel

  • #2
    If you want a tested solution, put a sample of your data using -dataex-.

    Otherwise (untested code follows) if the names you mention are variables in your dataset, you calculate as follows:

    Code:
    gen meansbp = (sbp1 + sbp2 + sbp3)/3
    
    gen meandbp = (dbp1 + dbp2 + dbp3)/3
    
    gen hyp = meansbp=>140 & meandbp=>90

    Comment


    • #3
      Originally posted by Emmanuel Banchani View Post
      How do I ensure that missing values are not represented as large values in Stata?
      Add the following (in red-colored font) to Joro's suggestion.
      Code:
      generate byte htn = meansbp >= 140 & meandbp >= 90 if !missing(meansbp, meandbp)

      Comment


      • #4
        One thing that I did not think through very well is what Joseph said. But there are many other questions marks here that Original Poster (OP) needs to elaborate.

        1. Absent any information from OP, what Joseph proposes is the most reasonable course of action. However it is not totally unreasonable to code people with missing values on the two measures as hyp=0, this would be if people with normal blood pressure who feel fine just do not go to the hospital and do not get tested.

        2. Also the first generation of meansbp and meandbp will generate a missing value if any of the three measures are missing. Do we really want that? Maybe if we have one of the three measures present, we want this to be the average. Etc.

        Comment


        • #5
          Thank you all for the answers. My main concern with the missing data issue was that, the data set I'm using, some participants have either the systolic and or diastolic blood pressure with zero values

          Comment


          • #6
            Joro with the data set I'm using, some people did not have their systolic and or diastolic blood pressure taken with the first, second and third measures due to faulty machine or they refuse. I hope this claries.

            Comment

            Working...
            X