Analyzing Census Data for Portland, Maine

Susan Li

March 15 2016

Today I would like to use R to understand demographics of the state of Maine, the city of Portland, and zipcode of 04101.

For this project, I will be using package “choroplethr” that simplifies the creation of choropleths (thematic maps) in R.

First, have a look the state data, head only.

##       region    value
## 1    alabama  4777326
## 2     alaska   711139
## 3    arizona  6410979
## 4   arkansas  2916372
## 5 california 37325068
## 6   colorado  5042853

So, what is the population of Maine?

##    region   value
## 20  maine 1329084

Let’s make a boxplot to see the distribution of population in the US, and where is Maine’s position.

##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
##   563000  1700000  4340000  6060000  6650000 37300000

The median population of a state in the US is over 4.3 million, 3 times of Maine’s population. And Maine’s population is less than the first quartile value. This indicates that about 75% of states have a population more than Maine’s, or about 25% of states have a population less than Maine’s.

Here you go. Now We can see which states are the most/least populated.

I think I like this color and scale better.

Let me drill down to some other interesting facts.

## [1] "region"            "total_population"  "percent_white"    
## [4] "percent_black"     "percent_asian"     "percent_hispanic" 
## [7] "per_capita_income" "median_rent"       "median_age"
## [1] 26824

The income per capita in Maine is $26824. and how is it to compare with the other states?

Not bad, almost in the middle.

How about the percentage of white population?

## [1] 94

Seems Maine is among the whitest states in the nation (caucasian population at 94%). Wikipedia says that Maine has the highest percentage of French Americans among American states and most of the French in Maine are of Canadian Origin and they came from Quebec as immigrants between 1840 and 1930. Interesting.

Now, how about county, or city?

After a quick google search, I found Portland Maine belongs to Cumberland County, the FIPS code for Cumberland County is 23005.

So the population of Cumberland County.

##      region  value
## 1180  23005 282143

A little over 282,000.

It’s hard to compare all counties across the US, because there are so many outliers(counties with extreme large population).

The national map does not tell us good story anymore, because there are so many counties. Let’s zoom in.

Apparently, Cumberland is the most populated county in Maine.

What is the median rent in Cumberland? And how is it to compare with other counties?

## [1] 847

Oh no, Cumberland county has one of the highest median rent, people who live there must be well off!

Now let’s drill down even further to the zipcode.

What is the population of the zip 04101?

##      region value
## 1067  04101 17844

It turns out, zip 04101 area is among the most populated zip areas in Maine. However, the most popuated zip area in Maine has 45087 people.

Let’s zoom in to the county level for the zipcode.

Still, zip 04101 area is one of the most populated zip areas in Cumberland county, and the most populated zip area in the county has 30639 people.

Let’s explore more details on the demographics of this zip area.

## [1] 24560

The income per capita in this zip area is $24560. Let’s see what that means.

Can anyone draw any inference from this map? It seems the highest income per capita in the county is above $60K, and lowest below $20K.

According to above maps, I’m already jealous of people who live in Portland Maine.