Announcement

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

  • Combining two categorical income variables

    Hi, I'm using a cumulative dataset of the European Social Survey from 2002-2018.
    In my analysis I want to control for household net income, a variable which has been changed in the dataset over time.

    In ESS 2002-2006 the income variable (hinctnt) has 12 numeric values whereas the income variable (hinctnta) in ESS 2008-2018 has 10 numeric values.
    I want to create a new variable which combines the 12 and 10 numeric values resulting in 22 income values or categories (in other words I do not want to combine the numeric value of for example 1 for the two variables).


    Attatched are two codebook commands of the relevant variables

    Kind regards
    Click image for larger version

Name:	income1.PNG
Views:	1
Size:	23.3 KB
ID:	1610075
    Click image for larger version

Name:	income2.PNG
Views:	1
Size:	19.6 KB
ID:	1610076








  • #2
    I believe this could work, but it very much depends on how your data is configured - hopefully it will set you on the right path anyway.

    Code:
    gen jointhinctnt = hinctnt
    _crcslbl jointhinctnt hinctnt
    replace jointhinctnt=(hinctnta+12) if hinctnta!=.
    label define jointhinctntlbl 13 "J hinctnta" 14 "R hinctnta" 15 "C hinctnta" 16 "M hinctnta" 17 "F hinctnta" 18 "S hinctnta" 19 "K hinctnta" 20 "P hinctnta" 21 "D hinctnta" 22 "H hinctnta" 23 "U hinctnta" 24 "N hinctnta"
    label values jointhinctnt jointhinctntlbl
    label variable jointhinctnt "Income ESS 2002-2006 and ESS 2008-2018"
    tab jointhinctnt, missing

    Comment


    • #3
      Thank you! I've actually accepted combining the numeric values using the following code:

      Code:
      egen hinctnt_hinctnta=rowtotal(hinctnt hinctnta)
      list hinctnt hinctnta hinctnt_hinctnta in 1
      recode hinctnt_hinctnta (0=.), gen(new_income)

      Comment

      Working...
      X