Use of data from IPUMS USA is subject to conditions including that users should cite the data appropriately. Use command `ipums_conditions()` for more details.
# 1) Define the full lookup as a little TSV in a stringocc_lookup <- readr::read_tsv("OCC\toccupation000\tN/A (not applicable)0010\tChief executives and legislators0020\tGeneral and operations managers0040\tAdvertising and promotions managers0051\tMarketing managers0052\tSales managers0060\tPublic relations and fundraising managers0101\tAdministrative services managers0102\tFacilities managers0110\tComputer and information systems managers0120\tFinancial managers0135\tCompensation and benefits managers0136\tHuman resources managers0137\tTraining and development managers0140\tIndustrial production managers0150\tPurchasing managers0160\tTransportation, storage, and distribution managers0205\tFarmers, ranchers, and other agricultural managers0220\tConstruction managers0230\tEducation and childcare administrators0300\tArchitectural and engineering managers0310\tFood service managers0335\tEntertainment and recreation managers0340\tLodging managers0350\tMedical and health services managers0360\tNatural sciences managers0410\tProperty, real estate, and community association managers0420\tSocial and community service managers0425\tEmergency management directors0440\tOther managers0500\tAgents and business managers of artists, performers, and athletes0510\tBuyers and purchasing agents, farm products0520\tWholesale and retail buyers, except farm products0530\tPurchasing agents, except wholesale, retail, and farm products0540\tClaims adjusters, appraisers, examiners, and investigators0565\tCompliance officers0600\tCost estimators0630\tHuman resources workers0640\tCompensation, benefits, and job analysis specialists0650\tTraining and development specialists0700\tLogisticians0705\tProject management specialists0710\tManagement analysts0725\tMeeting, convention, and event planners0726\tFundraisers0735\tMarket research analysts and marketing specialists0750\tBusiness operations specialists, all other0800\tAccountants and auditors0810\tProperty appraisers and assessors0820\tBudget analysts0830\tCredit analysts0845\tFinancial and investment analysts0850\tPersonal financial advisors0860\tInsurance underwriters0900\tFinancial examiners0910\tCredit counselors and loan officers0930\tTax examiners and collectors, and revenue agents0940\tTax preparers0960\tOther financial specialists1005\tComputer and information research scientists1006\tComputer systems analysts1007\tInformation security analysts1010\tComputer programmers1021\tSoftware developers1022\tSoftware quality assurance analysts and testers1031\tWeb developers1032\tWeb and digital interface designers1050\tComputer support specialists1065\tDatabase administrators and architects1105\tNetwork and computer systems administrators1106\tComputer network architects1108\tComputer occupations, all other1200\tActuaries1220\tOperations research analysts1240\tOther mathematical science occupations1305\tArchitects, except landscape and naval1306\tLandscape architects1310\tSurveyors, cartographers, and photogrammetrists1320\tAerospace engineers1340\tBiomedical and agricultural engineers1350\tChemical engineers1360\tCivil engineers1400\tComputer hardware engineers1410\tElectrical and electronics engineers1420\tEnvironmental engineers1430\tIndustrial engineers, including health and safety1440\tMarine engineers and naval architects1450\tMaterials engineers1460\tMechanical engineers1520\tPetroleum, mining and geological engineers, including mining safety engineers1530\tOther engineers1541\tArchitectural and civil drafters1545\tOther drafters1551\tElectrical and electronic engineering technologists and technicians1555\tOther engineering technologists and technicians, except drafters1560\tSurveying and mapping technicians1600\tAgricultural and food scientists1610\tBiological scientists1640\tConservation scientists and foresters1650\tOther life scientists1700\tAstronomers and physicists1710\tAtmospheric and space scientists1720\tChemists and materials scientists1745\tEnvironmental scientists and specialists, including health1750\tGeoscientists and hydrologists, except geographers1760\tPhysical scientists, all other1800\tEconomists1821\tClinical and counseling psychologists1822\tSchool psychologists1825\tOther psychologists1840\tUrban and regional planners1860\tOther social scientists1900\tAgricultural and food science technicians1910\tBiological technicians1920\tChemical technicians1935\tEnvironmental science and geoscience technicians, and nuclear technicians1970\tOther life, physical, and social science technicians1980\tOccupational health and safety specialists and technicians2001\tSubstance abuse and behavioral disorder counselors2002\tEducational, guidance, and career counselors and advisors2003\tMarriage and family therapists2004\tMental health counselors2005\tRehabilitation counselors2006\tCounselors, all other2011\tChild, family, and school social workers2012\tHealthcare social workers2013\tMental health and substance abuse social workers2014\tSocial workers, all other2015\tProbation officers and correctional treatment specialists2016\tSocial and human service assistants2025\tOther community and social service specialists2040\tClergy2050\tDirectors, religious activities and education2060\tReligious workers, all other2100\tLawyers, and judges, magistrates, and other judicial workers2105\tJudicial law clerks2145\tParalegals and legal assistants2170\tTitle examiners, abstractors, and searchers2180\tLegal support workers, all other2205\tPostsecondary teachers2300\tPreschool and kindergarten teachers2310\tElementary and middle school teachers2320\tSecondary school teachers2330\tSpecial education teachers2350\tTutors2360\tOther teachers and instructors2400\tArchivists, curators, and museum technicians2435\tLibrarians and media collections specialists2440\tLibrary technicians2545\tTeaching assistants2555\tOther educational instruction and library workers2600\tArtists and related workers2631\tCommercial and industrial designers2632\tFashion designers2633\tFloral designers2634\tGraphic designers2635\tInterior designers2636\tMerchandise displayers and window trimmers2640\tOther designers2700\tActors2710\tProducers and directors2721\tAthletes and sports competitors2722\tCoaches and scouts2723\tUmpires, referees, and other sports officials2740\tDancers and choreographers2751\tMusic directors and composers2752\tMusicians and singers2755\tDisc jockeys, except radio2770\tEntertainers and performers, sports and related workers, all other2805\tBroadcast announcers and radio disc jockeys2810\tNews analysts, reporters, and journalists2825\tPublic relations specialists2830\tEditors2840\tTechnical writers2850\tWriters and authors2861\tInterpreters and translators2862\tCourt reporters and simultaneous captioners2865\tMedia and communication workers, all other2905\tOther media and communication equipment workers3000\tChiropractors3010\tDentists3030\tDietitians and nutritionists3040\tOptometrists3050\tPharmacists3090\tPhysicians3100\tSurgeons3110\tPhysician assistants3120\tPodiatrists3140\tAudiologists3150\tOccupational therapists3160\tPhysical therapists3200\tRadiation therapists3210\tRecreational therapists3220\tRespiratory therapists3230\tSpeech-language pathologists3245\tOther therapists3250\tVeterinarians3255\tRegistered nurses3256\tNurse anesthetists3258\tNurse practitioners, and nurse midwives3261\tAcupuncturists3270\tHealthcare diagnosing or treating practitioners, all other3300\tClinical laboratory technologists and technicians3310\tDental hygienists3321\tCardiovascular technologists and technicians3322\tDiagnostic medical sonographers3323\tRadiologic technologists and technicians3324\tMagnetic resonance imaging technologists3330\tNuclear medicine technologists and medical dosimetrists3401\tEmergency medical technicians3402\tParamedics3421\tPharmacy technicians3422\tPsychiatric technicians3423\tSurgical technologists3424\tVeterinary technologists and laboratory animal caretakers3430\tDietetic technicians and ophthalmic medical technicians3500\tLicensed practical and licensed vocational nurses3515\tMedical records specialists3520\tOpticians, dispensing3545\tMiscellaneous health technologists and technicians3550\tOther healthcare practitioners and technical occupations3601\tHome health aides3602\tPersonal care aides3603\tNursing assistants3605\tOrderlies and psychiatric aides3610\tOccupational therapy assistants and aides3620\tPhysical therapist assistants and aides3630\tMassage therapists3640\tDental assistants3645\tMedical assistants3646\tMedical transcriptionists3647\tPharmacy aides3648\tVeterinary assistants and laboratory animal caretakers3649\tPhlebotomists3655\tOther healthcare support workers3700\tFirst-line supervisors of correctional officers3710\tFirst-line supervisors of police and detectives3720\tFirst-line supervisors of firefighting and prevention workers3725\tMiscellaneous first-line supervisors, protective service workers3740\tFirefighters3750\tFire inspectors3801\tBailiffs3802\tCorrectional officers and jailers3820\tDetectives and criminal investigators3840\tFish and game wardens and parking enforcement officers3870\tPolice officers3900\tAnimal control workers3910\tPrivate detectives and investigators3930\tSecurity guards and gaming surveillance workers3940\tCrossing guards and flaggers3945\tTransportation security screeners3946\tSchool bus monitors3960\tOther protective service workers4000\tChefs and head cooks4010\tFirst-line supervisors of food preparation and serving workers4020\tCooks4030\tFood preparation workers4040\tBartenders4055\tFast food and counter workers4110\tWaiters and waitresses4120\tFood servers, nonrestaurant4130\tDining room and cafeteria attendants and bartender helpers4140\tDishwashers4150\tHosts and hostesses, restaurant, lounge, and coffee shop4160\tFood preparation and serving related workers, all other4200\tFirst-line supervisors of housekeeping and janitorial workers4210\tFirst-line supervisors of landscaping, lawn service, and groundskeeping workers4220\tJanitors and building cleaners4230\tMaids and housekeeping cleaners4240\tPest control workers4251\tLandscaping and groundskeeping workers4252\tTree trimmers and pruners4255\tOther grounds maintenance workers4330\tSupervisors of personal care and service workers4340\tAnimal trainers4350\tAnimal caretakers4400\tGambling services workers4420\tUshers, lobby attendants, and ticket takers4435\tOther entertainment attendants and related workers4461\tEmbalmers, crematory operators, and funeral attendants4465\tMorticians, undertakers, and funeral arrangers4500\tBarbers4510\tHairdressers, hairstylists, and cosmetologists4521\tManicurists and pedicurists4522\tSkincare specialists4525\tOther personal appearance workers4530\tBaggage porters, bellhops, and concierges4540\tTour and travel guides4600\tChildcare workers4621\tExercise trainers and group fitness instructors4622\tRecreation workers4640\tResidential advisors4655\tPersonal care and service workers, all other4700\tFirst-line supervisors of retail sales workers4710\tFirst-line supervisors of non-retail sales workers4720\tCashiers4740\tCounter and rental clerks4750\tParts salespersons4760\tRetail salespersons4800\tAdvertising sales agents4810\tInsurance sales agents4820\tSecurities, commodities, and financial services sales agents4830\tTravel agents4840\tSales representatives of services, except advertising, insurance, financial services, and travel4850\tSales representatives, wholesale and manufacturing4900\tModels, demonstrators, and product promoters4920\tReal estate brokers and sales agents4930\tSales engineers4940\tTelemarketers4950\tDoor-to-door sales workers, news and street vendors, and related workers4965\tSales and related workers, all other5000\tFirst-line supervisors of office and administrative support workers5010\tSwitchboard operators, including answering service5020\tTelephone operators5040\tCommunications equipment operators, all other5100\tBill and account collectors5110\tBilling and posting clerks5120\tBookkeeping, accounting, and auditing clerks5140\tPayroll and timekeeping clerks5150\tProcurement clerks5160\tTellers5165\tOther financial clerks5220\tCourt, municipal, and license clerks5230\tCredit authorizers, checkers, and clerks5240\tCustomer service representatives5250\tEligibility interviewers, government programs5260\tFile clerks5300\tHotel, motel, and resort desk clerks5310\tInterviewers, except eligibility and loan5320\tLibrary assistants, clerical5330\tLoan interviewers and clerks5340\tNew accounts clerks5350\tCorrespondence clerks and order clerks5360\tHuman resources assistants, except payroll and timekeeping5400\tReceptionists and information clerks5410\tReservation and transportation ticket agents and travel clerks5420\tOther information and records clerks5500\tCargo and freight agents5510\tCouriers and messengers5521\tPublic safety telecommunicators5522\tDispatchers, except police, fire, and ambulance5530\tMeter readers, utilities5540\tPostal service clerks5550\tPostal service mail carriers5560\tPostal service mail sorters, processors, and processing machine operators5600\tProduction, planning, and expediting clerks5610\tShipping, receiving, and inventory clerks5630\tWeighers, measurers, checkers, and samplers, recordkeeping5710\tExecutive secretaries and executive administrative assistants5720\tLegal secretaries and administrative assistants5730\tMedical secretaries and administrative assistants5740\tSecretaries and administrative assistants, except legal, medical, and executive5810\tData entry keyers5820\tWord processors and typists5840\tInsurance claims and policy processing clerks5850\tMail clerks and mail machine operators, except postal service5860\tOffice clerks, general5900\tOffice machine operators, except computer5910\tProofreaders and copy markers5920\tStatistical assistants5940\tOther office and administrative support workers6005\tFirst-line supervisors of farming, fishing, and forestry workers6010\tAgricultural inspectors6040\tGraders and sorters, agricultural products6050\tOther agricultural workers6115\tFishing and hunting workers6120\tForest and conservation workers6130\tLogging workers6200\tFirst-line supervisors of construction trades and extraction workers6210\tBoilermakers6220\tBrickmasons, blockmasons, stonemasons, and reinforcing iron and rebar workers6230\tCarpenters6240\tCarpet, floor, and tile installers and finishers6250\tCement masons, concrete finishers, and terrazzo workers6260\tConstruction laborers6305\tConstruction equipment operators6330\tDrywall installers, ceiling tile installers, and tapers6355\tElectricians6360\tGlaziers6400\tInsulation workers6410\tPainters and paperhangers6441\tPipelayers6442\tPlumbers, pipefitters, and steamfitters6460\tPlasterers and stucco masons6515\tRoofers6520\tSheet metal workers6530\tStructural iron and steel workers6540\tSolar photovoltaic installers6600\tHelpers, construction trades6660\tConstruction and building inspectors6700\tElevator installers and repairers6710\tFence erectors6720\tHazardous materials removal workers6730\tHighway maintenance workers6740\tRail-track laying and maintenance equipment operators6765\tOther construction and related workers6800\tDerrick, rotary drill, and service unit operators, and roustabouts, oil, gas, and mining6825\tSurface mining machine operators and earth drillers6835\tExplosives workers, ordnance handling experts, and blasters6850\tUnderground mining machine operators6950\tOther extraction workers7000\tFirst-line supervisors of mechanics, installers, and repairers7010\tComputer, automated teller, and office machine repairers7020\tRadio and telecommunications equipment installers and repairers7030\tAvionics technicians7040\tElectric motor, power tool, and related repairers7100\tOther electrical and electronic equipment mechanics, installers, and repairers7120\tElectronic home entertainment equipment installers and repairers7130\tSecurity and fire alarm systems installers7140\tAircraft mechanics and service technicians7150\tAutomotive body and related repairers7160\tAutomotive glass installers and repairers7200\tAutomotive service technicians and mechanics7210\tBus and truck mechanics and diesel engine specialists7220\tHeavy vehicle and mobile equipment service technicians and mechanics7240\tSmall engine mechanics7260\tMiscellaneous vehicle and mobile equipment mechanics, installers, and repairers7300\tControl and valve installers and repairers7315\tHeating, air conditioning, and refrigeration mechanics and installers7320\tHome appliance repairers7330\tIndustrial and refractory machinery mechanics7340\tMaintenance and repair workers, general7350\tMaintenance workers, machinery7360\tMillwrights7410\tElectrical power-line installers and repairers7420\tTelecommunications line installers and repairers7430\tPrecision instrument and equipment repairers7510\tCoin, vending, and amusement machine servicers and repairers7540\tLocksmiths and safe repairers7560\tRiggers7610\tHelpers--installation, maintenance, and repair workers7640\tOther installation, maintenance, and repair workers7700\tFirst-line supervisors of production and operating workers7720\tElectrical, electronics, and electromechanical assemblers7730\tEngine and other machine assemblers7740\tStructural metal fabricators and fitters7750\tOther assemblers and fabricators7800\tBakers7810\tButchers and other meat, poultry, and fish processing workers7830\tFood and tobacco roasting, baking, and drying machine operators and tenders7840\tFood batchmakers7850\tFood cooking machine operators and tenders7855\tFood processing workers, all other7905\tComputer numerically controlled tool operators and programmers7925\tForming machine setters, operators, and tenders, metal and plastic7950\tCutting, punching, and press machine setters, operators, and tenders, metal and plastic8000\tGrinding, lapping, polishing, and buffing machine tool setters, operators, and tenders, metal and plastic8025\tOther machine tool setters, operators, and tenders, metal and plastic8030\tMachinists8040\tMetal furnace operators, tenders, pourers, and casters8100\tModel makers, patternmakers, and molding machine setters, metal and plastic8130\tTool and die makers8140\tWelding, soldering, and brazing workers8225\tOther metal workers and plastic workers8250\tPrepress technicians and workers8255\tPrinting press operators8256\tPrint binding and finishing workers8300\tLaundry and dry-cleaning workers8310\tPressers, textile, garment, and related materials8320\tSewing machine operators8335\tShoe and leather workers8350\tTailors, dressmakers, and sewers8365\tTextile machine setters, operators, and tenders8450\tUpholsterers8465\tOther textile, apparel, and furnishings workers8500\tCabinetmakers and bench carpenters8510\tFurniture finishers8530\tSawing machine setters, operators, and tenders, wood8540\tWoodworking machine setters, operators, and tenders, except sawing8555\tOther woodworkers8600\tPower plant operators, distributors, and dispatchers8610\tStationary engineers and boiler operators8620\tWater and wastewater treatment plant and system operators8630\tMiscellaneous plant and system operators8640\tChemical processing machine setters, operators, and tenders8650\tCrushing, grinding, polishing, mixing, and blending workers8710\tCutting workers8720\tExtruding, forming, pressing, and compacting machine setters, operators, and tenders8730\tFurnace, kiln, oven, drier, and kettle operators and tenders8740\tInspectors, testers, sorters, samplers, and weighers8750\tJewelers and precious stone and metal workers8760\tDental and ophthalmic laboratory technicians and medical appliance technicians8800\tPackaging and filling machine operators and tenders8810\tPainting workers8830\tPhotographic process workers and processing machine operators8850\tAdhesive bonding machine operators and tenders8910\tEtchers and engravers8920\tMolders, shapers, and casters, except metal and plastic8930\tPaper goods machine setters, operators, and tenders8940\tTire builders8950\tHelpers--production workers8990\tMiscellaneous production workers, including equipment operators and tenders9005\tSupervisors of transportation and material moving workers9030\tAircraft pilots and flight engineers9040\tAir traffic controllers and airfield operations specialists9050\tFlight attendants9110\tAmbulance drivers and attendants, except emergency medical technicians9121\tBus drivers, school9122\tBus drivers, transit and intercity9130\tDriver/sales workers and truck drivers9141\tShuttle drivers and chauffeurs9142\tTaxi drivers9150\tMotor vehicle operators, all other9210\tLocomotive engineers and operators9240\tRailroad conductors and yardmasters9265\tOther rail transportation workers9300\tSailors and marine oilers, and ship engineers9310\tShip and boat captains and operators9350\tParking attendants9365\tTransportation service attendants9410\tTransportation inspectors9415\tPassenger attendants9430\tOther transportation workers9510\tCrane and tower operators9570\tConveyor, dredge, and hoist and winch operators9600\tIndustrial truck and tractor operators9610\tCleaners of vehicles and equipment9620\tLaborers and freight, stock, and material movers, hand9630\tMachine feeders and offbearers9640\tPackers and packagers, hand9645\tStockers and order fillers9650\tPumping station operators9720\tRefuse and recyclable material collectors9760\tOther material moving workers9800\tMilitary officer special and tactical operations leaders9810\tFirst-line enlisted military supervisors9825\tMilitary enlisted tactical operations and air/weapons specialists and crew members9830\tMilitary, rank not specified9920\tUnemployed, with no work experience in the last 5 years or earlier or never worked",col_names =c("OCC", "occupation")) |>mutate(OCC =as.numeric(OCC))
Rows: 530 Columns: 2
── Column specification ────────────────────────────────────────────────────────
Delimiter: "\t"
chr (2): OCC, occupation
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Warning: There was 1 warning in `mutate()`.
ℹ In argument: `OCC = as.numeric(OCC)`.
Caused by warning:
! NAs introduced by coercion
# 2) Join & bucket into industriessnap_df <- ipums_data |>mutate(is.numeric(OCC)) |>filter(!is.na(OCC)) |>left_join(occ_lookup, by ="OCC") |>mutate(occ_num =as.numeric(OCC),industry =case_when( occ_num >=0& occ_num <1000~"Management, Business, Science, and Arts Occupations", occ_num >=1000& occ_num <2000~"Computer, Engineering, and Science Occupations", occ_num >=2000& occ_num <3000~"Education, Legal, Community Service, Arts, and Media Occupations", occ_num >=3000& occ_num <3600~"Healthcare Practitioners and Technical Occupations", occ_num >=3600& occ_num <4700~"Service Occupations", occ_num >=4700& occ_num <6000~"Sales and Office Occupations", occ_num >=6000& occ_num <7000~"Natural Resources, Construction, and Maintenance Occupations", occ_num >=7000& occ_num <7700~"Installation, Maintenance, and Repair Occupations", occ_num >=7700& occ_num <9000~"Production Occupations", occ_num >=9000& occ_num <9920~"Transportation and Material Moving Occupations", occ_num ==9920~"Unemployed, no recent work experience",TRUE~"Other" ) ) |>select(-occ_num)
# A tibble: 11 × 2
industry ind_diff
<chr> <dbl>
1 Computer, Engineering, and Science Occupations -0.0333
2 Education, Legal, Community Service, Arts, and Media Occupations -0.0419
3 Healthcare Practitioners and Technical Occupations -0.0243
4 Installation, Maintenance, and Repair Occupations -0.00535
5 Management, Business, Science, and Arts Occupations 0.0768
6 Natural Resources, Construction, and Maintenance Occupations 0.000951
7 Production Occupations 0.000319
8 Sales and Office Occupations -0.0191
9 Service Occupations 0.0328
10 Transportation and Material Moving Occupations 0.00875
11 Unemployed, no recent work experience 0.00437
Healthcare
snap_and_healthcov <- snap_design |>filter(!is.na(HCOVANY)) |>mutate(health_coverage =ifelse(HCOVANY==2, "Yes", "No"))snap_and_healthcov|>ggplot(aes(x = health_coverage, fill = snap_status)) +geom_bar() +labs(title ="Healthcare Coverage for SNAP vs Non-SNAP Recipients")