
Show HN: Crime Doesn't Climb in San Francisco - gwintrob
https://github.com/gwintrob/crime-doesnt-climb/blob/master/README.md
======
mturmon
There are a lot of confounding variables here, and others have mentioned a
few.

One I have not seen is "proximity to major arterials". Sometimes crime
concentrates around major streets and parking lots where cars can be stolen or
broken into. (The OP mentions "grand theft from locked auto" as being ~10% of
crimes, for example.)

Another common crime, shoplifting and petty thefts, occurs around strips of
shops, urban malls, transit stations, or bus stops.

These crimes really don't have to do with altitude, and they are common enough
to really affect results. The reason I know this is by inspecting the LAPD
compstat maps, which are superior, in many ways, to the linked one. One place
to see them is:

[http://www.crimemapping.com/map/region/LAPDHollywoodArea](http://www.crimemapping.com/map/region/LAPDHollywoodArea)

This is Hollywood. You can notice the concentration of crimes along Hollywood
Blvd, or the other major east-west streets. (The zoom tool is on the right,
and it may be good to increase the time span to a month.) Inspecting the
causes show they are often thefts from vehicles, etc., as mentioned above.

------
throwaway_yy2Di
This is invalid. The numbers calculated are counts of crime incidents, not
crime rates. A km^2 block with ten times the population density will have ten
times the number of crimes; this doesn't mean it is ten times more dangerous!

~~~
msellout
Crime per km^2 is just as valid as crime per person.

~~~
cbr
If I want to know the chances of someone breaking into my apartment I want the
data per-apartment. If I want to know the same for cars I want the data per-
car. If I want to know my chance of getting shot I want the data per-person.
Overall crimes per person approximates what we care about much better than
crimes per unit area.

~~~
jlgreco
> _If I want to know my chance of getting shot I want the data per-person_

In reality though, it isn't as simple as that. Sure, I don't want to be shot.
I _also_ don't want other people to be shot a lot in my neighborhood. If I
walk to work and see a car parked on the street has been broken into, that
bothers, even though my car is in a secure parking garage.

I don't want to be the victim of crime, but I _also_ don't want to live amidst
crime. I don't want to see it, I don't want to hear about it, and I don't want
to think about it. Crime per km^2 is nearly as important to me as crime per
capita.

~~~
derefr
To put it another way: if you live alone, statistics measured per-person are
directly applicable to the chance something will happen to you. If you have a
family who lives with you, though, the combined probability distribution of
something happening to _someone in your household_ changes quite dramatically.

~~~
cbr
These are rare events, so the chance of something happening to someone in your
family of N is close to N times the chance of it happening to you.

------
smtddr
I'd like a map overlay of median _(not average! that means nothing in SF!!!)_
income of those areas. Something tells me higher elevation = way more
expensive, especially here in SF.

I don't think the common thief is wandering about on billionaire-row[1]. I
think this has more to do with wealth than land-elevation itself.

[http://www.sfcityguides.org/desc.html?tour=34](http://www.sfcityguides.org/desc.html?tour=34)

~~~
ojbyrne
AFAIK, that's traditionally the way its been in SF. Altitude correlates with
wealth.

~~~
cgtyoder
Potrero Hill might be the exception.

~~~
geebee
It happens in the southern sections of the city too (which are not included on
the map). Ingleside Terrace is considerably more expensive than the OMI (ocean
view, merced heights, ingleside). Similarly, Mission Terrace, which not a posh
neighborhood, is nonetheless a bit more expensive than the Excelsior, which is
elevated ground toward McLaren Park.

------
codezero
What about weighted by population density?

~~~
gwintrob
Great point. There are a lot of interesting ways to analyze this data (e.g.
population, public transportation, home prices, etc.)

------
grandalf
More accurately, the MUNI doesn't climb. In the nicer areas there is no light
rail service, only a few filthy buses.

~~~
xxpor
Are you implying that public transportation causes crime?

~~~
seldo
There's a widely-held view that public transit is associated with higher crime
rates, but it's a myth:

[http://www.theatlanticcities.com/commute/2012/01/transit-
sta...](http://www.theatlanticcities.com/commute/2012/01/transit-stations-may-
actually-cut-down-crime/916/)

In fact, the data shows that if anything, introducing more transit will reduce
crime.

~~~
UVB-76
> In fact, the data shows that if anything, introducing more transit will
> reduce crime.

Careful. The provision of new or improved public transport facilities often
coincides with, or precedes, the gentrification of an area.

I'd hypothesize this is the more significant causal mechanism at play; ne'er-
do-wells driven out of an area by higher property prices.

~~~
grandalf
I think it's just incredibly inconvenient to get from the tenderloin to the
ritzy areas of SF by public transit. You pretty much need a car or car
service.

~~~
rdl
The TL is immediately adjacent to the rity commercial area (Union Square), to
the point where tourists accidentally walk there.

Bayview/HP aren't even that isolated -- the T muni line goes there, along with
lots of buses.

At some level it's inconvenient to go _anywhere_ in SF, but Pac Heights isn't
too hard to get to by transit. The Marina is low elevation, but separated by
some hills, but even that isn't inaccessible.

------
bdon
Interesting. I suspect elevation is highly correlated with land value, so
perhaps that is the hidden factor here?

I'd like to see this applied to other hilly cities. Great work!

------
rsync
Can we see the exact same study, but with SEC indictments and tax
fraud/evasion, etc. ?

I'll bet that "climbs" ...

~~~
SkyAtWork
Probably for the perpetrators, probably not for the companies involved (which
are likely to have the same set of Delaware and/or Cayman mailing addresses)
:-P

But sure, I would expect that white collar crime is unsurprisingly correlated.

Maybe not though - boiler room style phone banks of investor fraudsters are a
stereotype for a reason, and those aren't necessarily the high rent end of
town.

~~~
kennywinker
Are you counting the crime as happening at the place of business, or at the
home of the perp? It'd be hard to quantify, as WHERE a white collar crime
happens is not particularly material. You can cook the books at home or at
work.

------
brown9-2
Data that reports per-person activity needs to control for population density
in each section, otherwise it just becomes a population map.

[http://xkcd.com/1138/](http://xkcd.com/1138/)

------
Groxx
Hmm... I don't know if equal-area tells you much. As you go higher, you also
sometimes/often get _much_ rougher terrain. Population density might be more
useful?

------
spenrose
Pete Warden would like you to use public APIs:
[http://petewarden.com/2013/09/09/why-you-should-stop-
piratin...](http://petewarden.com/2013/09/09/why-you-should-stop-pirating-
googles-geo-apis/) . Also, the association of low ground with poverty is old.
Toni Morrison riffed on it in Sula:
[http://en.wikipedia.org/wiki/Sula_(novel)](http://en.wikipedia.org/wiki/Sula_\(novel\))

~~~
kennywinker
Very good article! The Data Science Toolkit he pumps as an alternative to
pirating google's APIs looks awesome, and deserves a direct link:
[http://www.datasciencetoolkit.org](http://www.datasciencetoolkit.org)

------
robotcookies
Throwaway makes a very valid point that crime per areas isn't very useful. But
even beyond that the map is also confusing because for the lower elevations it
shows both lower areas AND higher area crime incidents. Then as it goes
higher, it just shows the higher ones. In other words, it should really show
an outer ring for the lowest elevation (since that's where the lower areas
are) and then a smaller ring, etc. Only the highest areas would not have a
hole in the center (most likely).

Think of elevation maps and how you would select out one range of elevation at
a time - you'd end up with donut like rings. You wouldn't mark an area as 500
feet and show all the rings for 500 feet and up. Doing this makes it seem like
there are far more crimes than actual for the lower levels.

------
bluedino
How about showing it overlaid with a topographical map?

~~~
gwintrob
Yes, that would be a nice visualization.
[http://cartodb.com/](http://cartodb.com/) is a pretty powerful tool for these
kinds of maps.

~~~
idupree
TopOSM is Open Data (OpenStreetMap data) and is my go-to place for finding out
where hills are. [http://www.toposm.com/](http://www.toposm.com/) (For looking
at hills in cities, click the "+" on the right to get a menu where you can
toggle streets ("Map Features") on and off.)

------
anateus
This is a fun exploration, but there are just so many plausible additional
factors, from population density, to SFPD's selective enforcement, to many
others that can be at least as significant if not more so than this one.

This is not meant to be an exhaustive causal analysis. You try to control for
land mass, but don't really mention anything else that might indicate
elevation to be a less significant factor and I think that does a great
disservice to what otherwise is an interesting exercise.

~~~
mscarborough
"A great disservice"? Lighten up, this was a hackathon project, not a doctoral
thesis. And the code is there for anyone to build upon using other factors.

~~~
geebee
I agree. This is a good example of a small project that was worth getting out
there. The code is posted, so if it's triggering some ideas, that's kind of
the point - by all means, run with it!

------
jcampbell1
I suppose the the analysis would be better if it used Census Block Groups for
the grid. That it could better account for population density. Unfortunately
extracting CBG data is extremely painful. CBG data would also be slightly
problematic in that it is residence based, thus a place like NYC's Time Square
may show high crime rates per "resident", but is extremely safe.

Does anyone know where you can get a simplified CBG data dump? All you would
need are boundaries and population.

------
geebee
This is interesting, but on my browser, the map cuts out much of the southern
section of SF. Is it included in the numbers? This area may present a
particularly interesting section to study elevation changes.

[http://wikitravel.org/en/San_Francisco/Southeast](http://wikitravel.org/en/San_Francisco/Southeast)

~~~
mrb
On "your browser"? It is an animated gif, not a browsable map. All browsers
render the animated gif the same way.

~~~
valleyer
Though you could just possibly forgive him given that Google Maps-style
controls were left in the image?

------
Kurtz79
I guess street crimes are more frequent in areas where there is an higher
concentration of people/shops/bars etc.

I can't say I see a definite correlation with altitude: areas that are more
secluded from the main SF buzz like the Marina and the west coast show very
little crime, and they are basically at sea level.

------
vtcraghead
You want population and crime rate included in the analysis? Fine.
[http://geosprocket.blogspot.com/2013/09/crime-doesnt-
insert-...](http://geosprocket.blogspot.com/2013/09/crime-doesnt-insert-
variable.html)

------
ar7hur
Very interesting. Other comments have listed possible factors like population
density, public transportation (MUNI). I'd love to see the correlation with:

\- the derivative of elevation (i.e. the slope)

\- the street lightning

------
xycodex
What about adjusting for the greater probability that a given area is
residential the higher the elevation? Perhaps more crime occurs outside
residential areas. Just speculating here.

------
natural219
skwirl has the correct answer here, but it is buried in a sub-comment:

"I don't think the article is trying to claim that elevation magically has a
causal impact on crime rates. It just shows that there is a correlation and
claims nothing more. The point is that there IS some underlying root cause (or
an extreme coincidence) and that is an interesting point in and of itself."

[https://news.ycombinator.com/item?id=6355511](https://news.ycombinator.com/item?id=6355511)

------
pa5tabear
It it all JavaScript I'm looking at?

(I'm only ~halfway through the JS course on CodeCademy and don't know much
else programming related).

~~~
flixic
Yes, this is all JavaScript.

------
herf
Crime likes a way to escape. Going higher up might just give you fewer ways to
get away.

------
coherentpony
The first thing on that page is a GIF. There is no explanation. It is not
clear what the GIF is meant to be portraying. I even went on to read the first
two paragraphs, which also didn't explain what the GIF was supposed to be
illustrating.

After that I closed the page.

------
lowglow
We were just noting the same about poverty in San Francisco.

------
snake_plissken
Correlate with population density? Also, the time of day?

------
kata1yst
tl;dr Everyone in San Francisco, buy ladders.

