jsoma / data-studio-projects

12 stars 18 forks source link

Which US cities gained and lost the most people over the last year #133

Open mattrehbein opened 6 years ago

mattrehbein commented 6 years ago

Please complete all of the following sections, or the ghost of Joseph Pulitzer will spookily dance around your issue! A completed version of this template can be found at https://github.com/jsoma/data-studio-projects/issues/1

Pitch

Summary

I want to make graphs showing which US cities gained the most and lost the most people.

My population data came from US Census, and the employment data came from US Dept of Agriculture.

I want my data to look something like this: city_pop_ex_graph

Details

Possible headline(s): Cities Americans are flocking to, and fleeing

Data set(s): https://www.census.gov/data/datasets/2017/demo/popest/total-cities-and-towns.html#tables

https://data.ers.usda.gov/reports.aspx?ID=17828

Code repository: https://github.com/mattrehbein/data_studio/tree/master/code/01-city_pop_changes

Possible problems/fears/questions:

Work so far

screen shot 2018-07-11 at 12 27 25 pm

FRIDAY UPDATE: I've pulled county-level economic data for each city, and am trying to find the best way to include it in the population numbers for some context. My initial thought of putting population side by side in a bar graph with some economic indicator doesn't seem to make much sense now that i've done it. Included in the updated screen shot are examples pairing population increase with median household income and population percent change with unemployment rate.

Will keep playing with it, but I'm think final version with have economic data in separate chart(s).

image image

Checklist

This checklist must be completed before you submit your draft.

kellykiki commented 6 years ago
benbitoun commented 6 years ago

I would love to have this question answered by you: Why are people moving to Texas in masses? What makes these cities so attractive?

Same goes for the loosing ones. Is Baltimore constantly loosing people? Why? What does the city government against that?

mattrehbein commented 6 years ago

Update

I've pulled and cleaned all the county-level economic data for each to my top/bottom five cities for population. Unemployment rate seems to make the most sense to me to focus on (I think median income doesn't compare as well to a national average, because of cost of living differences). I made two new graphs showing the unemployment rates of the cities. Styles on the graphs are still a work in progress. I also moved everything into a cleaner notebook, as the first one had become too disorganized and marred by a pandas joining error (more on that below).

Your project content: images/words/etc

image image

Any changes in direction or topic?

I thought I'd be able to combine population numbers with some economic indicator in a single graph, but none of the different pairings I've tried made sense, so I broke the economic stuff into separate graphs.

Problems/Questions

The scope of the project will of course be pretty limited -- there are certainly many factors that determine why people move to or from a place. I'd have to single out a city or a state with several cities and really dig into this in detail, even if I still limited it to economic factors, to produce anything close to a satisfactory piece, I think. And, as my numbers show, population growth/loss does not coincide with low/high unemployment rate (relative to national average) in each of the cities' cases.

I was hamstrung for a good day or so by a joining problem in pandas; I was eventually able to work around it by changing the order of how I was combining bits from different data sets.

Also, in general, I'm finding it's a lot harder than I thought it would be to craft infographics totally from scratch. The hardest part is not the coding or tech issues with matplotlib. It's the editorial decisions: a idea (pairing together population data with the area's unemployment rate) sounds great as a general idea, but doesn't make nearly as much sense or isn't as meaningful as I thought it would be when I actually see it "in print." I'm sure that'll get better the more projects I do, but that's gonna be a steeper learning curve than I'd anticipated.

Checklist

troboukis commented 6 years ago

The story rocks. Use the average national unemployment rate for sure. I'd use a plot style for the graphs!

SimoneLuc commented 6 years ago

Very challenging story, like grafics, also the typo

playfairbot commented 6 years ago

Hi! I'm a little robot, let's see what's been going on here.

You need some feedback, let me summon @Palarisk, @linleysanders for you

Palarisk commented 6 years ago

Interesting work! I would combine the graphs with unemployment rates for shrinking cities and growing cities: It would be nice to be able to compare and see straight away if there's a correlation for that. You coud use different colors for shrinking and growing cities like you do now, so it would be easy to see the possible correlation.

mattrehbein commented 6 years ago

Final

Project visuals/text

ai_gained_pop gain_unemploy lost_pop lost_unemploy

Big population increases and decreases in urban areas may be indicative of regional or broader socioeconomic trends -- or maybe not. I thought it'd be interesting to see which US cities of a certain size (50,000 people or bigger) attracted the most new faces last year, and which waved goodbye to the most.

If Family Feud asked me what one thing draws people to a place, I'd say jobs, jobs, jobs. So I decided to pair big changes in population in US cities to those cities' unemployment rates. The results are mixed and do not suggest a simple, straight link between how many people move to or from a city and how many people are out of work in that city.

Of the five cities that lost the most people last year, three had unemployment rates above the national average, and only two of those were substantially higher. The number for the top five growing cities show a slighter stronger possible connection but are still mixed. In that case, all but one of the top five have lower unemployment rates than the national average, but only three are significantly lower.

So does job availability impact population? Maybe. A worthwhile endeavor might be to look at specific place experiences economic booms and see what the population numbers are around them.

Details

Headline: Is it the economy, stupid? Unemployment rates and big population changes in US cities

Published website version:

Code repository: https://github.com/mattrehbein/data_studio/tree/master/code/01-city_pop_changes

Final data set(s): US Census and US Dept of Agriculture.

What did you find to be the most difficult part of this project?

Visualizing the data was the hardest part. Graphing what ended up being my final charts was relatively easy, as they're very simple graphs, but getting there was surprisingly hard; my original concepts of the best way to represent the data in graphic form didn't make much sense when I went to execute on it. For example, I originally intended to show both population and an economic indicator in one graph, but putting a number in the thousands (population) and a small number like unemployment couldn't be scaled the same.

Are you satisfied with what you produced? Is there anything you would like to change or improve?

I'm fine with the final result. This was an idea I put together relatively quickly after being unable to find data on a different topic. And even though my final graphs are short and simple, I'm pretty please with how they look -- I'm sure that as my data-analysis skills grow, my infographics will become more complex, but at this stage producing clean graphics that clearly convey something is what I'm aiming for.

Checklist

benbitoun commented 6 years ago

Matt I still think this is a great story and one can see in the way you approached it that you are a very good (and self-critical) journalist. Your work didn't produce a simple answer - so what. I as a reader would definitely want to read it and as a journalist I would want to know if it's not exclusively or not at all because of jobs, then why are all these people moving to Texas and Arizona?

For the negative bar graph: I still like to read from left to right even though it's negative numbers, but I guess that's just a personal preference. In case you didn't know and would want to change it on another project I used this code to change it to left-right:

Changing the lims of the bars (from right to left) to (left to right)

plt.xlim([ 0,-2200]) ...(that's just the limit I gave it)

linleysanders commented 6 years ago

I love the initial chart you've created here, and it provides a simple understanding of unemployment and population rates. I look forward to seeing it cohesively laid out in Illustrator!

sarahslo commented 6 years ago

interesting. have you thought about making a scatterplot? screen shot 2018-07-24 at 8 02 10 pm

that way we can see everything at once. right now, i cannot. only problem here you have is that texas and california are the biggest states, so it makes sense that they have the biggest gains. can you look at the highest and lowest unemployment rates and then look at how those cities fared? instead of looking through the loss/gain numbers first?