Skip to content

Instantly share code, notes, and snippets.

@gebelo
Created September 5, 2014 21:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gebelo/2c0cbc37c3883033d276 to your computer and use it in GitHub Desktop.
Save gebelo/2c0cbc37c3883033d276 to your computer and use it in GitHub Desktop.
Bonus example:
The IPUMS SDA query interface allows you to collapse variables into broader categories. I do this often with occupations -- individual occupations are usually too small to carry a meaningful sample size, but if you look at the occupational hierarchy in the docs, you can see how you might tile up individual occupations into broader but still meaningful categories.
So try this.
1) Pick any sample to query
2) put sex as your column
3) put this as your row:
occ1990(r: 4-22; 23-37; 43-200; 203-235; 243-290; 303-391; 405-408;
415-427; 434-469; 473-498; 503-549; 558-599; 614-617; 628-699;
703-799; 803-890; 905; 991; 999; )
4) Put an age filter to get at the adult workforce, say age(18-64)
When you run the query, you'll get collapsed categories that correspond to this:
4-22 Executive, Administrative, and Managerial Occupations:
23-37 Management Related Occupations:
43-200 Professional Specialty Occupations
203-235 Technicians and Related Support Occupations
243-290 Sales Occupations:
303-391 Administrative Support Occupations, Including Clerical
405-408 Private Household Occupations:
415-427 Protective Service Occupations
434-469 Service Occupations, Except Protective and Household
473-498 Farming, Forestry and Fishing Occupations
503-549 Mechanics and Repairers:
558-599 Construction Trades
614-617 Extractive Occupations:
628-699 Precision Production Occupations:
703-799 Machine Operators, Assemblers, and Inspectors
803-890 Transportation and Material Moving Occupations
905 Military
991 Unemployed
999 N/A and unknown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment