# Re: st: Calculating Gini

 From Tom Trikalinos To statalist@hsphsun2.harvard.edu Subject Re: st: Calculating Gini Date Wed, 1 Sep 2004 22:29:01 +0300

```How about creating a new variable that would code state & district:

. egen stateDist = group(state district)

Then

. ginidesc income [fw=weight], by(stateDist)

Tom

On Sep 1, 2004, at 10:15 PM, Rijo John wrote:

```
Dear Stata users,

I was trying to calculate the gini coefficients using the formula

ginidesc income [fw=weight], by(state)

This gives me the desired results. But if I want to estimate it
for one more subgroup within "state", say some thing like

ginidesc income [fw=weight], by(state district)

It gives me the error

invalid syntax
r(198);

Cant I specify more than one subgroup variable in the by statement of this
formula? Or is there any other easy way to compute only the gini
coefficients in STATA with such "by" options. I mean, without decomposing
into "within" and "between" groups, I want to estimate only the gini with
the "by" option. I had seen the command "inequal" but this doesnt have a
"by" option.

Any help will be highly appreciated.

Thanks,

John.

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/

```*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```