Announcement

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

  • problem with --ineqdeco-- command

    Dear list members and Prof. Jenkins:
    I'm working on a project related to neighborhood effect. In each of my defined community there are two groups of residents (say A and B) ,my key identification strategy lies on whether there is a significant difference of household similarity, in terms of like income, education and other attributes, among two groups in each community. In other word, I don't care the absolute value but the dispersion rate. I tried to use the user-written command --ineqdeco-- to compute the gini coefficient like
    Code:
    ineqdeco income2012 if pub_house==1, bygroup(cid_new old_household)
    where cid_new is string variable representing varname for community and old_household is dummy for groupsA (old_household==1 if resident belong to group A, 0 otherwise ). However, I got an error message like "no observations" (which is not true) at the beginning of the command implement I guess that's due to the inappropriate setting of bygroup option , but I don't know why.
    What's more, given my limited subsample property (roughly 50 -100 households within a community, even smaller for each group), should I use bootstrap in my case?

  • #2
    You are probably using an out-of-date version of ineqdeco (although contrary to request you don't tell us where your version comes from).

    The bug in question was fixed in 2008. The version on SSC starts


    Code:
    *! 2.0.2 SPJ May 2008 (fix bug arising if bygroup() and `touse' lead to no obs in a group)
    *!   bug fix method provided by Austin Nichols (many thanks!)
    Hence try reinstalling:

    Code:
    ssc inst ineqdeco, replace
    Others will have better advice on bootstrapping and in particular respecting, or circumventing, cluster and spatial structure.

    Comment


    • #3
      Hi,Nick , thank you for your kindly and valuable remind , after I update to the new version, it works well for --bygroup-- option. However , another issue raise that, given I want to compute the gini coefficent in the subgroup level, in some case there is only very small number (say, only 2)of households in certain subgroup. It's obvious not reasonable to calculate gini coefficent in these cases and I can exclude them , but I have no idea what's the smallest number of observation for --ineqdeco-- to work, I need the exact number as condition to rule out the undesirable cases. Another issue is , --ineqdeco-- compute a branch of statistics include Atkinson class, gini coefficent and percentile ratios, but I only want to compute the gini coefficent, so in my case , what's the lowest amount of observation required? I hope Prof. Jenkins and other members who had encountered such problem can give me some suggestion, thank you.
      Code:
      gen gini_2012 = .  
      sort subgroup  
      
      quietly levelsof subgroup, local(levels)
      foreach i of local levels {
             ineqdeco income2012 [fw=familysize] if subgroup==`i'&ishead==1
             replace gini_2012 = $S_gini if subgroup == `i'
               }
      // After several loops, command give me error message
      no observations  
      r(2000);
      Last edited by Zhang_Lu; 16 Jun 2015, 01:28.

      Comment


      • #4
        The issue is not so much how many observations ineqdeco needs to work (or, rather, is needed by the formulae that it calculates), because the number is typically 2. Ask yourself whether there is really any substantive sense in trying to calculate inequality indices when the number of obs is tiny. (Think sampling variation, if nothing else.)

        From a programming point of view, you can insert a condition within your foreach statement and do your calculations depending on whether the condition is satisfied. In pseudo-code: first count if subgroup == `i' & ishead == 1, and use the relevant returned result in r(N) telling you the number of obs, either (a) to attribute a missing value to your inequality index, or else (b) the calculated value. You could also save the number of obs for each calculation to help with your post-calculation assessments.

        In addition, note that the Gini estimates are also saved in r(gini) -- see the help file for ineqdeco. (Referring to $S_gini is old-fashioned style, though will still work.)

        If you don't want to see the results for the other inequality indices in your log-file, think about using quietly in front of the foreach statement (but only once you're sure it's working as intended)

        Comment

        Working...
        X