Announcement

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

  • Stata 17- Percentages of the total sum

    Hello Everyone,
    I have a list of individuals and their incomes. I have divided them into 5 quintiles of income. I use the command below in Stata-17 to find the summation on incomes in each quintile (Q).
    table (Q)(), statistic (sum income)
    How can I add another column containing the percentages? I mean, what command should I use to calculate the share of each quintile in the total income of the sample?
    I appreciate your help.

  • #2
    Perhaps this example will point you in a useful direction.
    Code:
    . sysuse auto, clear
    (1978 automobile data)
    
    . table (foreign) (), statistic(sum price) statistic(percent price)
    
    -------------------------------
               |    Total   Percent
    -----------+-------------------
    Car origin |                   
      Domestic |  315,766     69.21
      Foreign  |  140,463     30.79
      Total    |  456,229    100.00
    -------------------------------

    Comment


    • #3
      Originally posted by William Lisowski View Post
      Perhaps this example will point you in a useful direction.
      Code:
      . sysuse auto, clear
      (1978 automobile data)
      
      . table (foreign) (), statistic(sum price) statistic(percent price)
      
      -------------------------------
      | Total Percent
      -----------+-------------------
      Car origin |
      Domestic | 315,766 69.21
      Foreign | 140,463 30.79
      Total | 456,229 100.00
      -------------------------------
      Dear William,
      Thank you. It is really helpful.

      Comment

      Working...
      X