The covid-19 pandemic has created all sorts of problems and ripples in the world – beyond, of course, the terrible damage that the virus and disease have caused to millions of people and their families.
One of these was a huge increase in the number of people quitting their jobs over the last few years. Some people decided that they wanted work that was more emotionally and personally satisfying. Others saw the pandemic as an opportunity to change their career path to something that earned more money. Or they moved to another location. Or they started a family. And so forth.
I’ve been to the US four times in the last year, and I’ve seen a lot of “help wanted” signs at various businesses. My parents (who live near Philadelphia) tell me that many businesses, including restaurants, have limited their opening hours, simply because they cannot find enough employees. (And if you’re thinking, “Maybe they would find employees if they were to pay better wages,” then you’re right… and welcome to the wonderful world of inflation!)
The US Bureau of Labor Statistics, part of the Department of Labor, tracks this information in JOLTS, where JOLTS is an acronym for "Job Openings and Labor Turnover Survey." They look at how many jobs are available in the US economy, and how many people have left their current job in search of a new one. This measure has become much more interesting over the last few years, and has been cited in a number of economic publications and shows that I follow.
There will always be some turnover in the economy. But the theory is that if more people are quitting their jobs, that shows optimism in the US economy. If fewer people are quitting their jobs, that shows people aren't so sure they'll get a new job elsewhere, and thus stick around -- even if they dislike the current job.
This week, we'll look at the JOLTS data. We will load all of the JOLTS data provided by the BLS, and then examine it to better understand whether there really was a rise in quits in the last two years, whether that has gone down at all, and how many job openings remain in the economy.
I should add that the JOLTS data is rich and fascinating, and we’re only going to look at a tiny portion of it. I definitely encourage you to look at it in greater detail, if this sort of economic statistic is interesting to you.
Data and questions
The data comes in a number of tab-separated CSV files, all available from https://download.bls.gov/pub/time.series/jt/. It might be useful to go through these, just to get a sense of what the files are. A full explanation of the files’ structure is at https://download.bls.gov/pub/time.series/jt/jt.txt.
Here’s what I want you to do:
- Read the series data (https://download.bls.gov/pub/time.series/jt/jt.series) into a data frame. Make the first column ("series_id") into the index. Note that the column names might contain extra whitespace, causing some trouble. Remove the "footnote_codes" column.
- Read the JOLTS data (https://download.bls.gov/pub/time.series/jt/jt.data.1.AllItems) into a data frame. Again, make the first column ("series_id") into the index. Again, remove the "footnote_codes" column.
- Create a new data frame combining all of the columns from these two.
- Find the most recent quits rate, across the entire United States, for all nonfarm jobs. This means getting the `QU` code, the 0 `industry_code`, and the `'00'` value for `state_code`. We'll ask for seasonally adjusted numbers and will be asking for a rate, rather than the absolute number (i.e., `'R'` for `ratelevel_code` and `'S'` for `seasonal`).
- There are 12 JOLTS reports per year. In each year on record, how many reports showed the quits rate to be higher than this most recent value?
- The states-name data (https://download.bls.gov/pub/time.series/jt/jt.state) lists four regions of the United States. Show the most recent quits data for the most recent time period. In which region are people quitting the most? The least?
- Create a plot showing the quits level for each of these four regions over time. The x axis should be time (year + period) and the y axis should be the quits rate. What region's quits rate is consistently the highest? Which is consistently the lowest?
- Create a data frame in which the index contains the year and period, and with two columns – the quits rate (QU) and the number of job openings (JO), both for the entire United States. How highly correlated are these values?
Learning goals for this week are joins, complex queries, pivot tables, multi-indexes, correlations, and some plotting.
I’ll be back tomorrow with detailed solutions.
Reuven
PS: Don’t forget that I’m holding a free webinar tomorrow about PythonDAB, my 4-month, online Python Data Analysis Bootcamp. Join me to learn more about my biggest and most ambitious course!