Announcement

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

  • survey income data by wealth quintile

    Hello,

    I am using Stata 15 to analyze survey income data by wealth quintile for households. Two questions:
    1. Do I use the sampling weight with xtile? This seems right, but it seems odd because I am also weighing the pie graph.
    2. What svy command can I use to just show me the proportion, total value, mean, and range by wealth quintile?

    Here is my code so far.

    Thanks much. Robert


    HTML Code:
    xtile quintile_totalincome = hhtotalincome [pweight = HHweight], n(5)
    graph pie totalincome_positive_values_US [pweight = HHweight] if HHhead==1, over(quintile_totalincome)
    svyset psu [pweight= HHweight]

  • #2
    You can get weighted quintiles with pctile, as it takes pweights. Once you have them:
    Code:
    svy:  tab quintile_totalincome  // proportions
    svy: mean hhtotalincome, over(quintile_totalincome)  // means
    svy: total hhtotalincome, over(quintile_totalincome)  //  totals
    bys quintile_totalincome: sum hhtotalincome   // min and max
    The pie chart show weighted percentages over categories. However with quintile categories, those percentages are equal (20%). Therefore the graph really conveys no extra information that I can see.
    Last edited by Steve Samuels; 15 Nov 2018, 09:57. Reason: Added reason not to use the pie chart.
    Steve Samuels
    Statistical Consulting
    [email protected]

    Stata 14.2

    Comment


    • #3
      Thanks a ton! Much appreciated.

      Comment

      Working...
      X