Announcement

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

  • Problem finding between-group P90/P10 ratio

    I have a data set of 20 000 individuals, each with an income (posFinc_5yr ) and a number indicating which city they live in (fdested). I want to group all individuals into regions (there are 19 regions), to eventually find a measure of income inequality between the regions. Ultimately I want to find the P90/P10 ratio between the regions.
    I first assigned the individuals into regions by using
    recode fdested (min/0194=1)(0201/0240=2)(0301=3)(0401/0440=4)(0501/0580=5)(0601/0681=6)(0701/0798=7)(0801/0835=8)(0901/0990=9)(1001/1047=10)(1101/1160=11)(1201/1301=12)(1401/1449=14)(1501/1576=15)(1601/1665=16)(1701/1780=17)(1801/1874=18)(1901/1943=19)(2001/2030=20), gen(fdested_group)

    Then I tried finding the inequality rato by using
    ineqdec0 posFinc_5yr, by(fdested_group)

    But I get an error message saying "no observations". What am I doing wrong?
    Thanks in advance!
    Nora

  • #2
    The fact that there are leading 0s in your city code suggests that fdested is a string variable and not a numeric variable, so I would start with checking that, and check whether fdested_group is what it is supposed to be.
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Following the same clue that Maarten points out (the leading 0s) another possibility is that fdested is a numeric variable with value labels. So it may be that the real values of fdested look like 1, 2, 3, 4, 5...etc.. If so, those would be the values that need to be used in the -recode- command, not the four-digit codes shown.

      I raise this alternative because if fdested is a string variable, I would expect -recode- to complain about that (with a very clear message that only numeric variables are eligible) and you would never even get to the -ineqdec- command.

      Comment


      • #4
        This is not about your specific problem but I would strongly urge you to create a new regional variable rather than to recode the city variable. Recoding like this will destroy the information on the respondent's city and you may need that later (for example, to check that you coded region correctly).

        Comment


        • #5
          @Richard: But his -recode- command has the -gen- option to create a new variable; the original is not lost.

          Comment

          Working...
          X