I have occupational data for a large set of countries over time that come from different types of sources.
The three types are "Labor force surveys", "Population Census" and "Other household survey".
My preferred datasource are Labor Force Surveys. So if this is available as source, I would like to drop the other two types.
The second preference would be Population Census and the third one other household surveys.
Now the countries differ in their data sources. I attached the example of Botswana below, where all three types of sources are available. In this case I would only like to keep "Labor Force Surveys" and drop the other two. In the case of other countries I only have only "Population Census" and "Other household surveys", so I would like to keep only "population census" and drop "other household surveys".
So the order of preferences would be
"Labor force survey">"Population Census">"Other Household Survey"
Is there a code to make this selection automatically?
Thanks and kind regards,
Jonas
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str33 country str62 occupation str35 typeofsource "Botswana" "1. Legislators, senior officials and managers (ISCO-88)" "Other household survey" "Botswana" "2. Professionals (ISCO-88)" "Other household survey" "Botswana" "3. Technicians and associate professionals (ISCO-88)" "Other household survey" "Botswana" "4. Clerks (ISCO-88)" "Other household survey" "Botswana" "5. Service workers and shop and market sales workers (ISCO-88)" "Other household survey" "Botswana" "6. Skilled agricultural and fishery workers (ISCO-88)" "Other household survey" "Botswana" "7. Craft and related trades workers (ISCO-88)" "Other household survey" "Botswana" "8. Plant and machine operators and assemblers (ISCO-88)" "Other household survey" "Botswana" "9. Elementary occupations (ISCO-88)" "Other household survey" "Botswana" "Total (ISCO-88)" "Other household survey" "Botswana" "X. Not elsewhere classified (ISCO-88)" "Other household survey" "Botswana" "1. Legislators, senior officials and managers (ISCO-88)" "Labour force survey" "Botswana" "2. Professionals (ISCO-88)" "Labour force survey" "Botswana" "3. Technicians and associate professionals (ISCO-88)" "Labour force survey" "Botswana" "4. Clerks (ISCO-88)" "Labour force survey" "Botswana" "5. Service workers and shop and market sales workers (ISCO-88)" "Labour force survey" "Botswana" "6. Skilled agricultural and fishery workers (ISCO-88)" "Labour force survey" "Botswana" "7. Craft and related trades workers (ISCO-88)" "Labour force survey" "Botswana" "8. Plant and machine operators and assemblers (ISCO-88)" "Labour force survey" "Botswana" "9. Elementary occupations (ISCO-88)" "Labour force survey" "Botswana" "Total (ISCO-88)" "Labour force survey" "Botswana" "X. Not elsewhere classified (ISCO-88)" "Labour force survey" "Botswana" "1. Legislators, senior officials and managers (ISCO-88)" "Population census" "Botswana" "2. Professionals (ISCO-88)" "Population census" "Botswana" "3. Technicians and associate professionals (ISCO-88)" "Population census" "Botswana" "4. Clerks (ISCO-88)" "Population census" "Botswana" "5. Service workers and shop and market sales workers (ISCO-88)" "Population census" "Botswana" "6. Skilled agricultural and fishery workers (ISCO-88)" "Population census" "Botswana" "7. Craft and related trades workers (ISCO-88)" "Population census" "Botswana" "8. Plant and machine operators and assemblers (ISCO-88)" "Population census" "Botswana" "9. Elementary occupations (ISCO-88)" "Population census" "Botswana" "Total (ISCO-88)" "Population census" "Botswana" "X. Not elsewhere classified (ISCO-88)" "Population census" end
0 Response to Create preference order for source of data
Post a Comment