Announcement

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

  • numeric variables still blue

    hi all
    i have this table of some data:
    . tab EF

    Latest LVEF Freq. Percent Cum.
    10 1 1.14 1.14
    15 4 4.55 5.68
    18 1 1.14 6.82
    20 11 12.50 19.32
    25 13 14.77 34.09
    30 22 25.00 59.09
    33 1 1.14 60.23
    35 19 21.59 81.82
    38.5 1 1.14 82.95
    40 15 17.05 100.00
    Total 88 100.00

    This table descrive an Heart pump function on the left side. the values are blue and when i write describe EF

    storage display value
    variable name type format label variable label
    EF byte %8.0g EF Latest LVEF
    i want to categorize the Groups in 4 categries:
    EF 0-10
    EF 11-20
    EF 21-30
    EF 31-40

    but i cant beaacuse stata cant recognize them as numer.

    Can you help?

  • #2
    I can't see any code that you're trying -- and your data look better left as they come -- but a simple way to make some progress would be

    Code:
    gen myEF = 10 * ceil(EF/10) 
    
    tab myEF

    Comment


    • #3
      Hey Nick
      i did what you said i got them in Black but i now lost my EF values:
      Latest LVEF Freq. Percent Cum.
      10 1 1.14 1.14
      15 4 4.55 5.68
      18 1 1.14 6.82
      20 11 12.50 19.32
      25 13 14.77 34.09
      30 22 25.00 59.09
      33 1 1.14 60.23
      35 19 21.59 81.82
      38.5 1 1.14 82.95
      40 15 17.05 100.00
      Total 88 100.00

      As you can see i have 1 with EF =<10
      and have 5 with EF >10 and <20
      ....
      .....
      ....

      So by your calculation i lost the Groups now i only have 10 and 20 ?? :/

      Comment


      • #4
        Again, I can't see the exact code you used and I have no idea how you can (appear to) have lost the EF values. Please back up and study https://www.statalist.org/forums/help#stata for advice on what to tell us. Your data are equivalent to


        Code:
        clear
        input LVEF    Freq
        10    1    
        15    4    
        18    1    
        20    11    
        25    13    
        30    22    
        33    1    
        35    19    
        38.5    1
        40    15    
        end
        
        expand Freq
        and for bins that are multiples of 10 my advice works:

        Code:
        gen myLVEF = 10 * ceil(LVEF/10)
         
        tab myLVEF
        
             myLVEF |      Freq.     Percent        Cum.
        ------------+-----------------------------------
                 10 |          1        1.14        1.14
                 20 |         16       18.18       19.32
                 30 |         35       39.77       59.09
                 40 |         36       40.91      100.00
        ------------+-----------------------------------
              Total |         88      100.00
        However, binning hides a minority of fine measurers (38.5!) and a majority of coarse measurers:

        Code:
        quantile LVEF
        dotplot LVEF
        spikeplot LVEF
        are among many graphical possibilities.


        Comment

        Working...
        X