Where I Should Live, According to Math

I don’t live in Washington, DC. I live near Washington, DC. I would like to live in it, but it’s an expensive city, and my income, while above the national average, is well below the regional average, and finding a two bedroom in our price range is difficult.

This got me thinking about affordable housing more broadly. For instance, where could I find a good, walkable neighborhood, anywhere in the country, that is within my price range? That got me started on my current project.

Using census data, I decided to map the variables of affordability and walkability. Affordability wasn’t hard; I mapped all the census tracts in the country that had a median income within $10,000 of mine, both above and below.Affordability

This shows me where I can afford to live, but a lot of the areas are rural places that I would never want to live in. My next task was to map walkability.

Walkability was harder to map. Even though Walkscore covers everywhere in America, it only offers it’s data in downloadable form for Washington, DC. So I downloaded the data, calculated the average Walkscore for census tracts in DC, downloaded virtually the entire American Community Survey, and compared the data therein to the average Walkscore to look for correlation. I found nineteen variables that had some significant correlation with Walkscore.VariablesI took each of these variables and gave them a score of one or zero, one if Walkscore would be above 70 at the value, or a zero if it would be below. Then I multiplied that score by each variables’ R-Square value, and added all the variables together to get a weighted Walkability score. I eliminated the bottom 50% of these values, and added the remainder to the map.Walkability

I was pretty happy with the result. With the exception of a few large tracts in western states, walkable places are where you would expect them to be; densely concentrated around major metropolitan areas

I intersected the two layers to get tracts that were both affordable and walkable.Intersected

This led to an interesting pattern: a few small, walkable town centers on the edge of metropolitan areas, but mostly urban neighborhoods outside of the downtown or in inner-ring suburbs.

However, it was still too many places to look at as a group, so I assigned a score to each tract based on how walkable and how affordable they are. I added these two together to get a combined score for what neighborhood would be best for us, based on these two criteria. In case you wanted the full equation for this score, it is

Combined score = (a – |a – b|) / a + ((if(c ≥ 373.6958, 1, 0) * 0.3153) + (if(d ≥ 21.2983, 1, 0) * 0.2725) + (if(e ≤ 38.8903, 1, 0) * 0.2803) + (if(f ≥ 68.0899, 1, 0) * 0.2971) + (if(g ≥ 67.4557, 1, 0) * 0.3350) + (if(h ≥ 59.9592, 1, 0) * 0.4048) + (if(i ≤31.4668, 1, 0) * 0.2529) + (if(j ≥ 65.5846, 1, 0) * 0.2734) + (if(k ≥ 65.3918, 1, 0) * 0.2839) + (if(l ≥ 58.6467, 1, 0) * 0.3533) + (if(m ≤35.7247, 1, 0) * 0.2576) + (if(n ≥226.8280, 1, 0) * 0.2763) + (if(o ≥78.1848,1, 0) * 0.2779) + (if(p ≥3.8273, 1, 0) * 0.2943) + (if(q ≥ 602.4307, 1, 0) * 0.2795) + (if(r ≤ 4.1293, 1, 0) * 0.2698) + (if(s ≥ 732.9079, 1, 0) * 0.2573) + (if(t ≥ 21.1155, 1, 0) *0.3974) + (if(u ≥82.4877, 1, 0) * 0.2810)) / 5.6596


a = Your Personal Income

Data for Each Tract from the American Community Survey:

b = Median Income

c = Nonrelatives in Household

d = % with at Least a Bachelor’s Degree

e = % Born in State of Residence

f = % 16 and Older in Labor Force

g = % 16 and Older in Civilian Labor Force

h = % 16 and Older Employed in Civilian Labor Force

i = % 16 and Older Not in Labor Force

j = % Females 16 and Older in Labor Force

k = % Females 16 and Older in Civilian Labor Force

l = % Females 16 and Older Employed in Civilian Labor Force

m = % 16 and Older Driving to Work Alone

n = Workers 16 and Older Walking to Work

o = Workers 16 and Older Commuting to Work by Other Means

p = % 16 and Older Commuting to Work by Other Means

q = Houses Built 1939 or Earlier

r = % 10-14 Years Old

s = Population 25-34 Years Old

t = % 25-34 Years Old

u = % 18 Years and Older

So, what got the highest score?

Capital Hill-01Capitol Hill, Seattle led the pack. To be honest, I was expecting something like a smaller, affordable Midwest town or something, but it the highest scoring areas were usually just outside of major downtowns. Other top areas included Cambridge and Somerville outside of Boston, and the South End in Boston; Columbia Heights, Washington, DC; The Mission District, Lower Haight, and Russian Hill, San Francisco; Midtown, Atlanta; Greenwood, Dyker Heights, Kensington, and Sheepshead Bay, Brooklyn; Graduate Hospital in Philadelphia, where we used to live; Lake View, Chicago; and Five Points, Denver.

Holly and I won’t be moving out of the region any time soon, but it’s good to have some idea of where to look if we decide to. And good to know that Columbia Heights is probably the neighborhood in DC for us, when the time comes. The formula isn’t perfect; it’s hard to control for things like how much of people’s income goes toward housing, and there is still a lot of wiggle room in these walkability measures. But it is a reasonable guideline that has provided interesting results.

UPDATE: I’ve gotten a few special requests for specific data on various areas, so I decided to make a little gallery of them below.


About Dave Munson
This blog is about architecture, cities, and myself.

71 Responses to Where I Should Live, According to Math

  1. Alai says:

    One wrinkle, at least when it comes to San Francisco: local laws, such as rent control and Prop. 13, benefit long-term residents at the expense of new arrivals. As a result, median income may have very little to do with how much it would cost you to move there.

  2. Bo Borgerson says:

    Coincidentally, the Walk Score office is located in Capitol Hill, Seattle. 😉

    Nice analysis!

  3. Pingback: Where I Should Live, According to Math | 8ii.in

  4. Do you have images in more detail? I would love to see what around Chicago made the grade, but these images don’t have the detail.

    Or maybe at least provide the calculated data?

    • Dave Munson says:

      Basically, if someone has asked for a specific area, I’ve made a map for them (I made one of Fort Collins, CO earlier that I linked to on Reddit). Chicago had a lot of good stuff along the north side and then some weaker areas that still made the cut sprinkled all throughout its suburbs (numbers just represent the tract number). South side is mostly empty, if I had to guess I would say because my income is probably higher than the median in those areas.
      Map of combined score for Chicago area

      • david.smith says:

        Can you make a map of Nashville?

        • Dave Munson says:

          One really strong tract just south of Vanderbilt, and a few weaker but qualifying tracts throughout the area. I added a gallery to the post which will have the Nashville map in there.

          • david.smith says:

            Thanks! Very interesting. The areas roughly correspond to common sense about the Nashville housing market, although I don’t think the areas are as walkable as the walk score would indicate. No one south of I-440 walks anywhere, and the green area south of Vanderbilt isn’t close to very good stuff. But that’s probably all a problem with the walk score methodology.

      • Awesome info. Any chance of getting some detail on LA/OC area?

        • Dave Munson says:

          LA is a beast. My analysis shows decent areas to the northwest, in a strip running from Santa Monica through Culver City and West Hollywood to Pasadena. These areas are of course very walkable, but showing that they are within my income range may be a bit misleading. I bet people spend more of their income on housing there than they might elsewhere in the country. There are also some decent spots in San Fernando and Burbank, as well as Long Beach. For OC, there are a few spots here and there, but it looks like Costa Mesa is probably the best bet. Map in the gallery.

  5. Pingback: Confluence: My Wiki

  6. myblake says:

    Just to follow up on what Alai said, San Francisco is really not very affordable as a new arrival. I’ve lived in both the Mission and Lower Haight, and while the walk score component is spot on, trying to get a reasonably priced apartment in either will basically require a time machine.

    Having also lived in Cambridge and Somerville MA I can say you might be better off there, though both are similarly gentrifying. I’ve heard rents are going up a lot in Seattle as well, but last I checked (within the last year) it’s still the most affordable of the bunch. I suspect the Atlanta, Philly and Denver options are reasonable.

  7. Erik says:

    No weather/temperature preferences?

    • Frank Ch. Eigler says:

      … and nothing about crime?

      • James says:

        Bracketing by income probably controls for crime fairly well. It probably also throws out perfectly nice college towns.

    • Lil Jimmy says:

      Yeah, I’ll take 300 days of sun in Denver over some walkability

  8. Lodewijk says:

    The only question is, is it a good idea to look only at the US?

    Even if you can’t speak a foreign language, the UK has plenty of countries too! India speaks English. South Africa speaks English too. The rest of the Caribbean pretty much came along with English too.

    Learning Spanish (or Portuguese) is just about the easiest thing to do for an American, so you could consider a lot more area with that.

    From a comparable data / census availability perspective it makes a lot of sense. For “walkability” and affordability, look elsewhere.

    • Lodewijk says:

      Great writeup and research by the way! Very interesting use of data. Wish we had a more or less common worldwide dataset to work with.

    • Dave Munson says:

      I agree, that would be a very worthwhile study. Unfortunately, the data isn’t readily available, and it would have taken a lot more time to put together.

  9. bob sykes says:

    A number of the finalists (Somerville e.g.) are truly bad areas to live because of crime. You need better set of criteria.

    • villen says:

      Wrong! Perhaps your info is a few decades out of date. Somerville’s city-data.com crime rate of 215 is lower than the national average of 301, and lower than some more expensive nearby towns like Cambridge (score 226) and Boston (364). Somerville is the most walkable, bikeable, livable, and friendly towns I’ve ever lived in. The main threat to it’s “where to live” advantage now is that prices are skyrocketing as people flock here.

    • Coemgen says:

      A tech savvy reader can Google crime rates (e.g., Somerville’s violent crime rate is less than the national median).

    • mjt says:

      None of the places on his list strike me as crime ridden, do you really think Somerville is dangerous? Always seemed nice to me, I’ve never felt unsafe walking around there at night.

    • David Boring says:

      I lived in Somerville for years. Never had an apartment broken into, never had a car stolen, never had any trouble on the street. It’s quite safe.

    • dk12 says:

      The only sketchy area of Somerville is around Foss park – and even that area has gotten a lot nicer in recent years. In fact – in Boston, the only truly “dangerous” area is around Geneva and Blue Hill Ave in Dorchester. Most of the city is pretty safe.

  10. It would be interesting to present a “tunneling through the cost barrier” version, where you calculate all the money you could save in automobile and healthcare costs by living a walkable lifestyle, and then raise the amount you can spend on housing accordingly. Each car you can drop is thousands of dollars a year you won’t be spending, not to mention the sanity benefits of a human powered commute.

  11. rs says:

    can you make this into an online service, a calculator where anyone can adjust inputs? is that already out there somewhere? thanks.

  12. Surprised you didn’t correct for cost of living.

  13. Russ says:


    Now that you have a kid, you also need to consider schools. In the DC Metro area, outside DC itself there are a number of excellent school systems. DC Public Schools are unfortunately not up to par. And Michelle Rhee did no good while there. In MD you have Montgomery County which also has a number of nationally ranked high schools. Fairfax County and Falls Church also have some good/great schools. But, I’m going to make a plug for Arlington County.

    Our school system is both big enough and small enough at the same time. Our son is in the International Baccalaureate program at Washington-Lee HS and it is outstanding. Arlington also has access to Thomas Jefferson High School for Science and Technology if your child has that inclination. We are dealing with an immense increase in the size of our student body. There ARE growing pains. But I feel that they will be resolved well.

    Another point about Arlington is that it has one of the higher proportions of citizens with advanced degrees relative to other jurisdictions in the US.

    AND Arlington is generally very walkable and bike friendly.

    My wife and I can’t think of a better place to raise our kid.

  14. CM says:

    Can I get a map of San Antonio, TX?

    • Dave Munson says:

      There wasn’t a lot in San Antonio, which sort of surprised me, so I added my affordability layer to the map, and it looks like much of the city is outside of my +/-$10,000 window from my income. Map was added to the gallery.

      • CM says:

        Don’t know what your income figure is, but…can you re-run it 80k +/- 5k? The question just became a lot let theoretical for me today.

  15. Any chance you can publish your code for your work? Or list the tools / libraries that you used?

  16. David Boring says:

    This is AWESOME! Thanks for doing it.

    Could you do Porland, OR? We want to move from Bangor, ME (pretty darned affordable,) to Portland, OR, but my GF is convinced that it’s all unaffordable. If you the time, I’d really appreciate it. Thanks!

    • Dave Munson says:

      Downtown Portland and areas you might have heard of like the Pearl District are out of my price range, but there are good options on the city’s east side, as well as reasonable ones in Beaverton and Vancouver, WA. Map in the gallery.

      • Amy says:

        I’m baffled by the word “affordable” being used here. I guess we have different definitions of the word. I’m familiar with a lot of these places (including Metro DC) b/c I’ve lived in them or watched friends struggle to stay in their “affordable” neighborhood when their rental house was sold or torn down and turned into condos.

        Also, you consider Portland’s Pearl District outside of your price range but Capitol Hill in Seattle within your range? That confuses me.

        I’m also completely stunned that anyone would consider any neighborhood in San Francisco “affordable.” (Boston, too, is getting to be outrageously expensive. Pretty much your entire list had me shaking my head and thinking, Man I wish I could afford to live in those places.)

  17. Chris says:

    Great analysis, I live between Columbia, SC and Augusta, GA and was wondering what spots overlapped there?

    • Dave Munson says:

      Doesn’t look like there’s a whole lot. While there are affordable areas and walkable areas, they just don’t seem to overlap often. I will say that I would have thought Augusta would have more walkable areas, so I wonder if there might be a flaw in my data. Map in the gallery.

  18. AdamTE says:

    Very nice analysis!
    Curious about other major academic centers such as St. Louis and Philadelphia.While St Louis is generally considered affordable, not many communities are very walkable. It would be fascinating to add in a crime dimension as well. Again, very nice!

    • Dave Munson says:

      St. Louis has a few medium strength areas, including the downtown area and a few areas to the west. Philadelphia, where I lived for four years and fell in love with after about three and a half years, has some really strong areas just outside of Center City (including my beloved and missed Graduate Hospital/South of South), as far north as Fishtown and as far south as Bella Vista, with strong areas in Manayunk and East Falls, as well as some of the more urban suburbs such as Phoenixville and West Chester. Maps in the gallery.

  19. BC says:

    Could you give a shot at what Austin, Texas looks like. Please. The housing and rents here are insane.

    • Dave Munson says:

      Looks to me like the best options are south of the river just across from Downtown or a little further out to the north. Austin looks like it’s really walkable, but affordability is an issue. Map in the gallery.

  20. Engineer's Digest says:

    Nice one. Really well-researched.

  21. Pingback: What are the most walkable cities in America? | Web Watch

  22. ruralcounsel says:

    As someone who has spent plenty of time in Cambridge MA, I dispute its walkability. It’s high crime; unless you are in very select spots near T stops things are not terribly close or convenient; and any walking in the winter is prone to slush and ice issues.

    That counter-example forces me to question your methodology.

  23. DBD Pookie says:

    I see the Pullman/Moscow area where I live in on there.. nice to know that I live in such a great place.. Like I didn’t already know,but still!

  24. Colin Dick says:

    Do you plan of publishing the code?
    The ability to weight the factors that are important to “me” could be a consideration…
    As mentioned above, schools & other criteria may also need to be considered

  25. I will go wherever the jobs are, rent cheaply, own a low total-cost-of-ownership car, and live frugally. Makes me more available to travel or move if necessary, which is essential for tech.

  26. The Ted says:

    I think that instead of using the correlation of each individual ACS variable with “walk score”, you want to put all of the ACS variables into a linear regression with walk score on the LHS. After estimating this for D.C., you can use the coefficients on this regression to predict the walk score (along with a 95% prediction interval) for all of the other census tracts. Then, you could do any of the following:

    – plot walk score vs. income (guessing that they will have a positive relationship)
    – find the most walkable neighborhood for any given income level.

    I think that this might give a slightly different result, since it doesn’t depend on the 70% WS cutoff for every single ACS variable.

  27. Pingback: Math: Capitol Hill’s Miller Park neighborhood is awesome | CHS Capitol Hill Seattle

  28. alexkg413 says:

    A man after my own heart! Awesome project. A few quibbles after a relatively cursory read:

    1. How do you know the ACS variables correlated to WalkScore in DC are the same that would be correlated elsewhere? Different places are different.

    2. I bet for a project that’s getting recognition like this, you could get WalkScore to grant you access to their data for the whole country. Sometimes all it takes is asking, and they might like the positive press.

    3. Why did you look at the R-squared for variables individually rather than for the model as a whole? I bet there are some variables in there that don’t add a lot to the predictive power of the model for WalkScore on their own.

    4. You need a better projection for your map, dude. I like the NAD 1983 Contiguous USA Albers projected coordinate system.

    Overall, cool project! Thanks for doing it!

    • alexkg413 says:

      Also, why do you think that having an AMI close to yours means that the census tract is affordable? There are much more sophisticated ways to look at this, like housing affordability and cost of living expenses. One related attempt it the MIT Living Wage Calculator: http://livingwage.mit.edu/

  29. Jason Gohlke says:

    Given that neither rent nor real estate prices are included in your formula, it is deeply flawed from a real-world perspective. As a prior commenter essentially said, you can’t conclude that you’ll find an apartment you can afford to live in based on the median income of current residents of San Francisco (or anything else you’re analyzing). I live in San Francisco (relatively near Russian Hill) and it is indeed lovely and walkable…. but not affordable for most.

  30. fiona jackson says:

    I happen to live on Capitol Hill, for many of the reasons you listed. I love the walkability. But, it also helps that I grew up close to Seattle.

  31. Pingback: Math deems Capitol Hill the best place to live in the country

  32. Jeff Kaufman says:

    This method is showing you a mixture of “walkable neighborhoods” and “neighborhoods with the kind of people who in DC prefer walkable neighborhoods”. More: http://www.jefftk.com/p/walkability-via-census

  33. dave says:

    Awesome! I live in Capitol Hill (around the corner from Miller Park), and I can confirm that it is indeed the best place to live.

  34. Doug Getner says:

    I live in Capitol Hill and while it’s walkable, it’s so f’ing rainy!!! Ick

  35. I live in the first house to the right of the word Miller Park in the above picture. Things were not always so idyllic. In fact the group of people who coined the name “Miller Park” got together because they were irked by the drug dealing and prostitution on the school playground (the area marked Miller Park on the picture above). It took a great while but persistence paid off: http://seattletimes.com/html/dannywestneat/2004166554_danny06.html

  36. Correction: I live in the house immediately below the k in “Miller Park”!

  37. Ron says:

    This is awesome, what type of programs did you use to do the analysis and mapping?

    • Dave Munson says:

      I pretty much just used Google Docs to do some of the calculations and QGIS to do some of the calcs and all of the mapping.

      • Ron says:

        Great, thanks!

      • I was going to ask the same thing. I’ve wanted to do this kind of math (using similar terms, actually) for my own housing search, so these will be super helpful. Thanks for being so thorough, and for showing your work!

  38. Pingback: Today’s Headlines | Streetsblog USA

  39. dk12 says:

    there are walkable neighborhoods in the Boston area that you’re leaving out because your income range is too narrow – for example, Roslindale (neighborhood has a walk score of 69, but if you live closer to the center it’s in the 80s) and Jamaica Plain probably have a median income more than 10k below yours, but there is a huge range in socio-economics and demographics in both these places, and you’d get more for your money compared to the other places you’ve listed. Brookline is in the other direction – likely more than 10k above your income – but if your price range is putting you in the South End or Cambridge, you could probably afford to live in Brookline.

  40. Celi says:

    I guess I’m not very cool about following the colors in your maps. Maybe I missed some codes some place? Would someone kindly let me know how to interpret the colored areas. Thanks.

  41. Pingback: Roundup 8-29-2014 | tampasphere

  42. Pingback: What we're reading - cool maps and more | Community BuildersCommunity Builders

  43. lopi says:

    Feel like adding another layer with data from greatschools.org?

  44. Could you map Sarasota florida? thanks.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: