Hi!
So the survey data I'm looking at had a question on occupation which included a tick box for each of 8 different types of occupations. Each occupation option has been coded as a separate variable in my data set however and just gives the 'yes' responses.
Not great for working out the overall relative proportions of who does what as a job so want to have a new composite variable that lists each occupation as 1,2,3,...8.
Have tried
but what happens is that instead of var q107_1 being coded as 1, q107_2 coded as 2 and so on, it just creates a variable with no observations whatsoever.
Not sure if there's something I'm not doing before the egen command that I should be? Or perhaps if there is a better command to achieve this variable creation?
Not a very confident user of the egen command so any tips and advice would be very appreciated!
Cheers,
Maddie
So the survey data I'm looking at had a question on occupation which included a tick box for each of 8 different types of occupations. Each occupation option has been coded as a separate variable in my data set however and just gives the 'yes' responses.
HTML Code:
type: numeric (int) label: q107_1 range: [1,1] units: 1 unique values: 1 missing .: 415/471 tabulation: Freq. Numeric Label 56 1 Yes 415 .
Have tried
HTML Code:
egen occupation=group( q107_1 q107_2 q107_3 q107_4 q107_5 q107_6 q107_7 q107_8 q107_9), label (471 missing values generated)
Not sure if there's something I'm not doing before the egen command that I should be? Or perhaps if there is a better command to achieve this variable creation?
Not a very confident user of the egen command so any tips and advice would be very appreciated!
Cheers,
Maddie
Comment