Announcement

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

  • Generating Disease Combinations

    Hi all
    I want help in generating all the possible combinations using 20 variables(diseases) in STATA.
    I want combinations of three variables. How will I do that?
    These variables are binary in nature.
    For example, I want to have a combination like c1+c2+c3 and if this adds to 3 then assign yes(=1) for this new variable of the combination
    Please help.

  • #2
    Palak:
    take a look at the -group- function available from -egen-.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      I don't think I understand what you want, and I suspect few others do either. Without going into all the details of the difficulties here, I'd encourage you to 1) show a concrete example of your data set using -dataex-, as requested in the FAQ; 2) include concrete examples of what you mean by a "combination;' and 3) show and describe the rules for how you want particular combinations to map to the new variable.
      Depending on what you mean, some of what you describe may not be possible, since the combinations of 20 variables taken 3 at a time is 1140.

      Comment


      • #4
        Good advice so far, and here is more advice:

        All possible combinations of 20 diseases seems to pivot on each person having a disease or not, so 2^20 or 1 million or so combinations. Not clear what you want there.

        At the other extreme for binary variables, you can just calculate say c1 + c2 + c3 and the sum will be presumably be 0, 1, 2, or 3 (or missing), so are you asking for how to add variables in Stata?

        Code:
        gen wanted = c1 + c2 + c3
        is a good starting point.

        Comment


        • #5
          Thank you all for your suggestions.
          I actually made all the diseases in binary form (yes/no) and then just took most prevalent ones for making combinations.
          Further used only yes(1) for calculating prevalent combinations of disease in the population.
          Thank you Nick Cox for your suggestion. I used almost similar strategy.
          Also, this paper is published now.

          Thanks a ton for helping out.

          Regards

          Comment


          • #6
            Palak:
            notifying your audience that your paper in published without providing full reference is only half self-promotion!
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Greetings for the day.

              Here's the link to our published work entitled "
              Gender differences in the Prevalence and Pattern of Disease Combination of Chronic Multimorbidity among Indian Elderly" that I mentioned in my earlier messages.

              https://link.springer.com/article/10...26-021-09419-9

              Thank you sir Carlo Lazzaro for your suggestion.

              Regards
              Palak

              Comment


              • #8
                Palak:
                many thanks indeed.
                Congrats' on your & Mauria publication; just downloaded.
                For those, like me, who are interested in this kind of researches, the paper is avaialble as an open access contribution at: https://link.springer.com/article/10...26-021-09419-9.
                More substantively, please call me Carlo (like all on and many more off) this list do. Thanks.
                Kind regards,
                Carlo
                (Stata 19.0)

                Comment

                Working...
                X