DC

Recent posts

Sketching D.C. Crime Data With R

A car burglar last week nabbed a radio from our car, prompting me to think (once again) about crime in Washington, D.C., where I live.

I wanted to know if certain crimes were more common in particular neighborhoods, so I downloaded a list of every serious crime in 2012 from the city’s data portal. The data contained about 35,000 reported incidents of homicides, thefts, assaults, etc., with fields listing the date, time and neighborhood associated with each case.

I used the statistical programming language R, which is great for quickly creating small multiples to examine data, to make some rough visual sketches.

First, since we’re talking about cars, the first grid shows thefts from vehicles, by hour and “advisory neighborhood commission“. These commissions are the small groups of officials who represent their respective D.C. neighborhoods on issues like real estate development and alcohol sales, among other things. (I live in Brookland, which is governed by ANC 5B). You can find your ANC here.

It’s clear that thefts from vehicles are most common in ANC 1B, a diverse, densely populated and rapidly changing section of the city. For those familiar with D.C., this is Shaw, U Street and parts of Columbia Heights. The x-axis shows the hour of the crime, and the y-axis shows the total number of crimes. My neighborhood is relatively safe, actually:

theftfromcar2012

Next we look at robberies, which appear common in ANC1A, which also contains Columbia Heights and Park View. Notice the spikes in the early-morning hours in the ANCs 1A and 1B, compared to the late-night spikes in ANCs 8B and 8C, both of which are in the far southeast neighborhoods like Anacostia and Buena Vista. These are among the poorest areas in the city. I’m not sure what that means, but it’s interesting:

robbery2012

Burglaries…

burglary2012

Car thefts…

cartheft2012

Assaults with dangerous weapons…

assault2012

Here are the homicides — all of which get coded as occurring at midnight, so we don’t get to distribution by hour. Still, the result is a simple bar chart that shows the variance by region  (7D and 8E had more homicides last year than other locations).

homicide2012

Here’s the grid with all these crimes above (also including a small number of arson cases):

allcrimes

And here’s a grid with histograms for each offense type. Simple thefts (there were more than 12,000 last year) appear to be most commonly reported in the afternoon, while thefts from vehicles are most often reported first thing in the morning — probably because victims notice the crime when they wake up.

Screen Shot 2013-07-08 at 12.32.53 PM

Again, these are just quick sketches, but they show you the power of R in exploring your data before investing time in a more complicated visualization. A look at the basic code also shows how quickly these types of sketches can happen.

Previously:

Mapping ‘Rich Blocks, Poor Blocks’

Rich Blocks, Poor Blocks” allows users to get information about income in their neighborhoods, using the 2006-2010 American Community Survey estimates* compiled by the U.S. Census Bureau. Here’s a map of Washington, D.C., which — as I’ve noted before — is segregated by race, educational attainment and income:

Source: Rich Blocks, Small Blocks

Source: Rich Blocks, Small Blocks

* These data have high margins of error in small geographic units like Census tracts, which this service uses, so don’t take the figures literally. Still, the estimates can be useful for spotting broader trends about communities.

Thanks to the wife for sharing this discovery.

Mapping Crime Data With CartoDB

Today I started playing with CartoDB, an online data mapping service that reminds me in some ways of both Google Fusion Tables and TileMill.

To start, I grabbed a simple test data set — five months of geocoded major crimes in D.C. from January to May this year — to check out some features. One I like is allowing users to query their data in the browser-based interface and filter for specific types of records.

Here, for example, I narrowed the map to show just thefts:

Assaults with deadly weapons:

Vehicle thefts:

Thefts from vehicles:

Robberies:

Homicides:

I made these maps in less than five minutes, so I’m sure there are much more useful stories to tell with the tool. There are also many, many features I didn’t explore, like the ability to style the map using Carto, the CSS-like language, rather than the UI.

Anyway, give it a shot, and let me know what you build.

Charting Car Burglaries in DC

Last week someone burglarized our car. Fortunately the burglar didn’t get much, if anything, and a window wasn’t smashed. (Someone left the door unlocked, apparently). But it was a reminder that, even though our Brookland neighborhood is quiet and safe, we’re still vulnerable to property crimes. Then this morning I noticed that a neighbor’s driver-side window had been smashed in a burglary.

Looking at the data, it doesn’t appear that car burglaries are on the rise in our larger neighborhood, Ward 5. Residents here reported 109 car burglaries in January, for example, but only 59 in April. There also doesn’t appear to be a week-to-week uptick in April. I wondered whether the time of year makes car burglaries more likely, so I downloaded six years of major crime data (170,000 incidents of murder, robbery, theft, car theft, arson, sexual abuse, and vehicle burglary) to find out.

This chart shows the six-year trend, by month, in the city for car burglaries. There has been an uptick in recent history during May, it seems. Incidents of the offense have then leveled off before spiking again in the fall:

Our ward has shown a somewhat similar trend:

Data source: data.dc.gov

Charting Our Nightmare Water Bill

The folks at DC Water have had trouble updating our account since we closed on a new house in January. They figured it out recently, though, and we got a four-month bill over the weekend. It was a whopping $460. This, even though our previous bills with the agency — in a comparably sized rental house down the street — were typically $30-50 a month.

There must be a mistake, right? I called the agency this morning and got a data dump of our daily meter readings (yes, they have the technology to capture this daily, but they have trouble moving customers).

Armed with the data, I built this interactive line chart, which shows our daily water usage in the last 97 days. Notice the spike in mid-March. The city says we used 30,000 gallons of water in a four-day period, or about 80 percent of our overall use since January. (We average about 420 gallons a day with these outliers. If you remove the spike, we used about 80 gallons per day).

Clearly, something went wrong:

See larger, interactive version made with Highcharts.

How Many Cops Does Your Local Government Have Per Resident?

Does Washington, D.C., have more cops than other cities? That’s the question I asked myself the other day after watching a patrol car drive down our quiet, residential street. I see patrol cars everywhere — much more often than I did previous cities like Houston and Austin.

There’s a reason: Among the top 50 most-populous local governments, D.C. simply has more police officers per resident, according to the U.S. Department of Justice, which surveyed large police forces a few years ago. The city has about 670 cops per 100,000 residents, well ahead of Chicago, which was second with about 472 per 100,000. Houston had about 220, and Dallas had about 260.

Of course, D.C. is the capitol and diplomatic center of the country, and it’s densely populated with pockets of high crime and poverty. So a large officer to resident rate is understandable. But it’s a bit surprising how much D.C.’s ratio eclipses that of other major cities.

This chart shows the cities among the top 50 that have the highest per-resident officer ratio:

Here are the data for all 50 cities plotted on a map made with TileMill. Larger symbols represent higher numbers of officers per 100,000 residents:

See larger, interactive version

Data source: U.S. Bureau of Justice Statistics

A ‘Radical’ View of DC’s Demographics

I’ve been obsessed with William Rankin’s ‘radical cartography’ site for more than a year. One map in particular — a detailed view of Washington, D.C.’s segregated neighborhoods — has stuck with me more than others over time.  

The map used 2000 Census data to show how black residents are clustered in northeast and southeast neighborhoods, while white residents live in the northwest. He also mapped poverty, income, crime and education — creating a stunning series of images about inequality in the city.

I don’t have Rankin’s cartography skills, but I’ve tried my best to update his race map, using similar colors and features, with the 2010 Census data. First, this map shows concentrations of black residents, who made up roughly half the city’s population in 2010, down 10 percentage points from the previous decade: 

This map shows where Hispanic residents are clustered: 

Here’s another version with all major race/ethnicity groups. The dots represent 25 residents per U.S. Census block: 

All the data used to make the maps can be download here

DC vs. Austin Weather: Part 2

Back in May I compared the weather in my former town, Austin, Texas, to my current home, Washington, DC. Now that I’ve lived through a summer here, I’ve revisited the topic with two simple line charts.

This first chart shows monthly averages. As you can see, Austin experienced 100-degree average high temperatures in July and August (with little rain), setting the stage for the destructive wild fires spreading around the city

View larger, interactive version

Here’s a day-by-day comparison: 

View larger, interactive version

Data source: Weather Underground | Download: Days | Months

‘Hunkered Down’ With Some DC Hurricane History

Using the NOAA’s cool hurricane tracker, I discovered that Washington, DC, hasn’t received a direct hit from a hurricane in recorded history. (And, of course, Hurricane Irene won’t pass directly over our city either).

It has, though, endured three tropical cyclones, all of which were unnamed: 

The first, a tropical storm from 1933, crossed directly over American University in northwest DC:

The second, in 1939, was a tropical depression. It moved through southeast DC along the Anacostia River near what’s now RFK Stadium: 

The last, in 1945, was something called an extratiopical cyclone. It clipped southeast DC: 

 

It’s getting windy outside. I should save this post before we lose power…