I have a household survey with the following variables:
Age of respondents (by year, so basically 0 years old, 1 year old, 2, 3, 4, etc... until 100)
Gender (i.e. male or female)
I am trying to create a new variable that would be broken down by age brackets in 5 year intervals (so from 0 to 5, 6 to 10, 11 to 15, etc.. until we reach 100) but also broken down by gender, so each of these brackets for males and females separately.
I've tried several codes but I cannot seem to get the right variable, I've tried foreach and I've tried forvalues and I've tried generating a new variable with totals. Could you please let me know what the best way to go about this is?
Many thanks,
Rana
Age of respondents (by year, so basically 0 years old, 1 year old, 2, 3, 4, etc... until 100)
Gender (i.e. male or female)
I am trying to create a new variable that would be broken down by age brackets in 5 year intervals (so from 0 to 5, 6 to 10, 11 to 15, etc.. until we reach 100) but also broken down by gender, so each of these brackets for males and females separately.
I've tried several codes but I cannot seem to get the right variable, I've tried foreach and I've tried forvalues and I've tried generating a new variable with totals. Could you please let me know what the best way to go about this is?
Many thanks,
Rana
Comment