Announcement

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

  • Average income for data in ranges


    Dear Stata community

    I am new to stata and I'm trying to calculate the average but my data for income is in ranges, can anyone help me

    R1 584 – R7 167
    R7 168 –R16 417
    R16 418 – R33 333
    R7 168 –R16 417
    R16 418 – R33 333
    R33 334 – R57 333
    R7 168 –R16 417
    R57 334 – R123 417
    R16 418 – R33 333
    R7 168 –R16 417
    R123 418+

    I want it to be like this, but I don't know the command.
    Q34 N mean sd min max
    1. 0 - R1 583 25 477.44 323.077 100 1296
    2. R1 584 – R7 167 14 621.357 733.049 0 2900
    3. R7 168 –R16 417 26 1321.346 1055.126 70 4100
    4. R16 418 – R33 333 30 1370.6 1120.689 100 4520
    5. R33 334 – R57 333 19 1153.421 743.845 100 2600
    6. R57 334 – R12~417 6 1187.333 1043.200 300 3110
    7. R123 418+ 7 1694.286 1361.786 500 4270
    Thank you.

  • #2
    Andy:
    you may find what follows interesting/helpful: https://www.statalist.org/forums/for...-as-new-column
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Thank you, Carlo.

      Is there a way I can do it like the second table(have the numbering under Q34) without having the blocks?

      Comment


      • #4
        Andy:
        sorry, I'm away from my computer at the moment and cannot test.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment

        Working...
        X