Announcement

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

  • Table with string values

    Hello,

    I have a table for 3 numeric variables by 3 groups:

    tabstat var1 var2 var3, by(group)
    Var1 Var2 Var3
    Group 1 1.1 400 5.5
    Group 2 1.3 500 5.8
    Group 3 2.5 600 4.5

    Now I would like to define thresholds for "low" and "high" values of the variables such that I get the following table.
    Var1 Var2 Var3
    Group 1 Low Medium Medium
    Group 2 High Low Medium
    Group 3 High High Low
    Does someone know how to implement this with STATA code?

    Best

  • #2
    I cannot come up with whatever your rule is based on the two tables above (e.g., for var2 you seem to have 400 as medium, 500 as low and 600 as high) - if you supply rules for what values are included in each of low, medium and high, I'm quite sure someone could help

    Comment


    • #3
      Thank you!

      This was just a random example so please do not interpret the low and high labels in the second table.

      Lets just say that for instance high means var1>1.3 and high means var2 >500

      Comment


      • #4
        first, I just note that if you want 3 categories for each variable then you need more than one simple rule per variable

        second, my guess is that what you want is to use -recode- on each variable, with the gen option to create a new variable after you have recoded into 3 categories - then label the new variables

        Comment


        • #5
          Thank you Rich Goldstein
          Do you have a STATA code suggestion how to implement this? Because in table 1 the mean values are listed

          Comment


          • #6
            apparently I wasn't clear enough so maybe someone else can help you if they understand what you want

            Comment

            Working...
            X