Announcement

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

  • How to find Gini coefficient per group?

    Hey there, inexperienced Stata user here. I have read FAQ but did not find the answer to my question..So I would love to find the Gini coefficient for each prvince. I have tried to run ineqdeco percy , by(prov), but received r(2000) error and the message "no observations".
    Click image for larger version

Name:	Schermafbeelding 2023-05-20 150727.png
Views:	1
Size:	23.4 KB
ID:	1714305

    Click image for larger version

Name:	Schermafbeelding 2023-05-20 150820.png
Views:	1
Size:	93.7 KB
ID:	1714306

    Click image for larger version

Name:	Schermafbeelding 2023-05-20 150854.png
Views:	1
Size:	88.0 KB
ID:	1714307



  • #2
    Update: For the experiment I tried to run ineqdeco percy, by(region). Region is a numeric value, and it worked. I guess the problem is that "prov" is a non-numeric value?

    Comment


    • #3
      ineqdeco is from SSC. The rule is explained in the help:


      groupvar must take non-negative integer values only. To create such a variable from an existing variable, use the egen function group.
      In fact, you may be using an out-of-date version of ineqdeco. The error message I got was more informative:

      string variables not allowed in option bygroup();

      Comment

      Working...
      X