Baltimore Crime in Day and Night

Some crimes in the Charmed City happen “in plain daylight” while others happen mostly at dark, but is there a real difference or just a perceived one?

René F. Najera, MPH, DrPH
10 min readNov 7, 2021

--

I got curious and decided to look at some of the Baltimore City open data on crime. Then I got the idea of analyzing it to see if some crimes were more likely to happen in the daytime than at night. For this, I was going to need data on when sunrise and sunset happened in Baltimore. Lucky for me, someone had already gotten curious about getting sunrise/sunset data on a specific location. All I had to do was adapt their code and make some pretty graphs.

First, the data. Head on over to the Open Baltimore portal and download a data set on Part 1 Crime. I downloaded it as a .csv file, which makes it easy to load into R.

d <- read_csv("baltimore_crime_data.csv")

The data I downloaded goes from January 1, 2016, to October 31, 2021. It has all sorts of interesting data in there on a lot of crime.

t.1 <- table(d$Description)
kable(t.1)
|Var1 | Freq|
|:--------------------|-----:|
|AGG. ASSAULT | 32049|
|ARSON | 966|
|AUTO THEFT | 22854|
|BURGLARY | 34018|
|COMMON ASSAULT | 46879|
|HOMICIDE | 1927|
|LARCENY | 55673|
|LARCENY FROM AUTO | 32037|
|RAPE | 1899|
|ROBBERY - CARJACKING | 2961|
|ROBBERY - COMMERCIAL | 4758|
|ROBBERY - RESIDENCE | 2952|
|ROBBERY - STREET | 18128|
|SHOOTING | 4130|

The table also has information on whether the crime happened inside or outdoors.

t.2 <- table(d$Description,
d$Inside_Outside)
kable(t.2)
| | I| Inside| O| Outside|
|:--------------------|-----:|------:|-----:|-------:|
|AGG. ASSAULT | 11711| 578| 12688| 927|
|ARSON | 391| 10| 400| 17|
|AUTO THEFT | 1463| 453| 17766| 203|
|BURGLARY | 26309| 69| 1785| 1072|
|COMMON ASSAULT | 23849| 413| 11833| 1120|
|HOMICIDE | 0| 315| 0| 1612|
|LARCENY |…

--

--

René F. Najera, MPH, DrPH

DrPH in Epidemiology. Associate/JHBSPH. Adjunct/GMU. Epidemiologist. Father. Husband. (He/Him/His/El)