Announcement

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

  • How to Create an Alternative Health Index?

    Hi,

    I have 14 dummy health indicators. Each indicator has a value of 0 if the person is free of that disease and 1 if the person has it. I want to construct a simple index using the fraction of the conditions that the individual does that have so that a higher index value will indicate better health. I want to create it for each observation in the dataset. IDHH is the id variable and SURVEY is the time dummy.

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input int SURVEY double IDHH int(MB3 MB4 MB5 MB6 MB7 MB8 MB9 MB10 MB11 MB12 MB13 MB14 MB15 MB17)
    1  10201020 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010201 0 0 1 1 0 0 0 0 0 0 0 0 0 1
    1  10201020 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010201 0 0 1 0 0 0 0 0 0 0 0 0 0 0
    1  10201020 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010201 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201020 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010201 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201020 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010201 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201020 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010201 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201020 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010201 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201020 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010201 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201020 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010201 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201020 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010201 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201020 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010201 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201020 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010201 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201030 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010301 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201030 0 0 1 0 0 0 0 0 0 0 0 0 0 0
    2 102010301 0 0 1 0 0 0 0 0 0 0 0 0 0 0
    1  10201030 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010301 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201030 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010301 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201030 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010301 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201030 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010301 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201030 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010301 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201040 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010401 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201040 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010401 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201040 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010401 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201040 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010401 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201040 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010401 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201050 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010501 0 0 0 1 0 0 0 0 0 0 0 0 0 0
    1  10201050 0 0 0 1 0 0 0 0 0 0 0 0 0 0
    2 102010501 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201050 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010501 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201050 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010501 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201050 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010501 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201050 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010501 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201060 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010601 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201070 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010701 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201070 0 0 0 0 0 0 0 0 0 0 0 0 0 1
    2 102010701 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201070 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010701 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201070 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010701 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201070 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010701 0 0 0 1 0 0 0 0 0 0 0 0 0 0
    1  10201070 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010701 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201070 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010701 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201080 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010801 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201080 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010801 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201080 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010801 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201080 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010801 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201080 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010801 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201080 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010801 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201090 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010901 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201090 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010901 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201090 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010901 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201090 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010901 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201090 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    2 102010901 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    1  10201090 0 0 0 0 0 0 0 0 0 0 0 0 0 1
    2 102010901 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    end
    label values SURVEY SURVEY
    label def SURVEY 1 "IHDS1 1", modify
    label def SURVEY 2 "IHDS2 2", modify
    label values MB3 health
    label values MB4 health
    label values MB5 health
    label values MB6 health
    label values MB7 health
    label values MB8 health
    label values MB9 health
    label values MB10 health
    label values MB11 health
    label values MB12 health
    label values MB13 health
    label values MB14 health
    label values MB15 health
    label values MB17 health
    label def health 0 "No", modify
    label def health 1 "Yes", modify

  • #2
    Code:
    // first reverse the coding of the health variables: 1 no disease, 0 has disease
    foreach var of varlist MB? MB?? {
        replace `var' = 1 - `var'
    }
    label def health 0 "yes" 1 "no", modify
    
    // make index
    egen health = rowmean(MB? MB??)
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Maarten Buis Thank you for the assistance. I had a quick follow-up. Can we adjust this measure based on age? I am trying to use the log of the health index. The majority of the observations have health scores equal to 1. Suppose the gap between the survey dummy is 7 years.

      Will it be better to just divide the health variable by 7 or should I do inverse hyperbolic transformation?

      Comment


      • #4
        I guess it is preferable to keep the original coding of health variables. Even if such reserving is needed, generating new (temporary) ones is still advisable.

        One more thing: although you do mention a "fraction", you may consider the direct index of counting, which serves well for your desire.
        Code:
        egen wanted= anycount(MB*), v(0)

        Comment


        • #5
          Originally posted by Romalpa Akzo View Post
          I guess it is preferable to keep the original coding of health variables.
          In the original question Jose stated that he wanted an index "so that a higher index value will indicate better health", so that is why you would need to reverse the coding.

          Originally posted by Romalpa Akzo View Post
          Even if such reserving is needed, generating new (temporary) ones is still advisable.
          I used to think that to. However, one should always keep the original data unchanged, and only create analysis datasets using .do files. If you follow those rules, than there is not much value in creating new (temporary) variables.

          Originally posted by Romalpa Akzo View Post
          One more thing: although you do mention a "fraction", you may consider the direct index of counting, which serves well for your desire.
          If there are no missing values, then one is just a linear transformation of the other.

          ---------------------------------
          Maarten L. Buis
          University of Konstanz
          Department of history and sociology
          box 40
          78457 Konstanz
          Germany
          http://www.maartenbuis.nl
          ---------------------------------

          Comment


          • #6
            Originally posted by Jose Williams View Post
            Can we adjust this measure based on age?
            In what way?

            ---------------------------------
            Maarten L. Buis
            University of Konstanz
            Department of history and sociology
            box 40
            78457 Konstanz
            Germany
            http://www.maartenbuis.nl
            ---------------------------------

            Comment


            • #7
              Maarten Buis Since the time gap between the two data is 7 years. I was thinking whether it would be appropriate to adjust for age to account for the time gap. However, I think so the problem will get solved by including age and age squared as regressors.

              Comment

              Working...
              X