Announcement

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

  • How to form groups

    I have a panel data set with the following variables: Income, age (in years), gender (dummy), region (dummy), and education (four categories). I want to create separate groups for each year in which people have the same gender, region, education category and age (+/- 10 years). How can I do this? Then I have to sort for each group.

  • #2
    The general suggestion is to check out "egen group". If you follow what is in the FAQ (link above under the page title) and provide same sample data, we may be able to give you more concrete suggestions.

    But I have some issue with the bold part:

    I want to create separate groups for each year in which people have the same gender, region, education category and age (+/- 10 years). How can I do this?
    This does not seem feasible if you you plan to only have one grouping variable. Let's say A is 20, and B is 30, and C is 40 years old. Your scheme cannot reasonably capture this because A and B will be in the same group. B and C in the same group, but B cannot have two different age groups. This will happen to nearly every case.

    Comment


    • #3
      Perhaps you mean just that you want to round age, and ways of doing that are discussed at possibly tedious length in Stata Journal | Article

      Comment

      Working...
      X