Hello,
I am trying to create a variable called "mean reference wage" which is equal to the mean wage of everyone in a specified category (using the egen command). To specify the category I use people of similar age using the bysort command. Thus far I have managed to create 5 age groups of 10 years each and bysorted using age group. For example, people who are 21-30 will be in the same category, 31- 40, 41-50, etc. Using bysort and egen I therefore get the mean wage of people in each age group.
Now instead of that I would like to define the age group such that people compare themselves to individuals who are up to 3 years younger and up to 6 years older. So someone who is 29 would care about the mean wage of people between the ages of 26 and 35 (not: 21-30 as is the case now). Is there any way of doing that?
Thank you!
I am trying to create a variable called "mean reference wage" which is equal to the mean wage of everyone in a specified category (using the egen command). To specify the category I use people of similar age using the bysort command. Thus far I have managed to create 5 age groups of 10 years each and bysorted using age group. For example, people who are 21-30 will be in the same category, 31- 40, 41-50, etc. Using bysort and egen I therefore get the mean wage of people in each age group.
Now instead of that I would like to define the age group such that people compare themselves to individuals who are up to 3 years younger and up to 6 years older. So someone who is 29 would care about the mean wage of people between the ages of 26 and 35 (not: 21-30 as is the case now). Is there any way of doing that?
Thank you!
Comment