library(tidyverse) # Load all the functions everything else that I need to do the codes
library(dplyr)
library(ggplot2)
library(pROC)
library(car)Final project data 101
Introduction
How do geographic and crime-related factors affect the likelihood that a reported incident is classified as a Crime Against Property?? This dataset is called “Crimes” where it has 492k rows and 30 columns. It was created on March 24, 2015 and was last updated on May 7, 2026. It can be found at https://data.montgomerycountymd.gov. I am focusing on the results of the variable Crime1. Where there are mutiple different types of crimes in Crime1, and I will try to find what variables affect the result of Crimes against property undert Crime 1. So I will try to use other variables such as City, Sector and more. I choose this topic because I was curious about the crimes that happens in this county.
Load the libraries
setwd("C:/Users/kenne/Downloads")
Crimes <- read.csv("Crime_20260507.csv")EDA
str(Crimes)'data.frame': 491070 obs. of 30 variables:
$ Incident.ID : int 201573987 201573985 201573976 201573971 201573958 201573957 201573956 201573955 201573954 201573953 ...
$ Offence.Code : chr "9105" "9199" "2999" "9109" ...
$ CR.Number : int 260019565 260019574 260019562 260019557 260018359 260018358 260018357 260018355 260018354 260018353 ...
$ Dispatch.Date...Time : chr "" "" "05/06/2026 01:26:35 PM" "05/06/2026 12:26:24 PM" ...
$ Start_Date_Time : chr "05/06/2026 02:20:00 PM" "05/06/2026 02:15:00 PM" "05/06/2026 01:26:00 PM" "05/06/2026 12:36:00 PM" ...
$ End_Date_Time : chr "05/06/2026 03:00:00 PM" "" "" "05/06/2026 01:30:00 PM" ...
$ NIBRS.Code : chr "90Z" "90Z" "290" "90Z" ...
$ Victims : int 1 1 1 1 1 1 1 1 1 1 ...
$ Crime.Name1 : chr "Crime Against Society" "Crime Against Society" "Crime Against Property" "Crime Against Society" ...
$ Crime.Name2 : chr "All Other Offenses" "All Other Offenses" "Destruction/Damage/Vandalism of Property" "All Other Offenses" ...
$ Crime.Name3 : chr "LOST PROPERTY" "POLICE INFORMATION" "DAMAGE PROPERTY (DESCRIBE OFFENSE)" "RECOVERED PROPERTY - OTHER" ...
$ Police.District.Name : chr "GERMANTOWN" "BETHESDA" "TAKOMA PARK" "BETHESDA" ...
$ Block.Address : chr "20000 BLK AIRCRAFT DR" "9500 BLK SEVEN LOCKS RD" "400 BLK CIRCLE AVE" "5100 BLK STRATHMORE AVE" ...
$ City : chr "GERMANTOWN" "BETHESDA" "TAKOMA PARK" "KENSINGTON" ...
$ State : chr "MD" "MD" "MD" "MD" ...
$ Zip.Code : int 20874 20817 20912 20895 20855 20855 20855 20855 20855 20855 ...
$ Agency : chr "MCPD" "MCPD" "TPPD" "MCPD" ...
$ Place : chr "Street - Other" "School - Elementary/Secondary" "Construction Site" "Residence - Single Family" ...
$ Sector : chr "N" "E" "T" "D" ...
$ Beat : chr "5N1" "2E2" "8T3" "2D1" ...
$ PRA : chr "702" "207" "808" "694" ...
$ Address.Number : int 20000 9500 400 5100 7300 7300 7300 7300 7300 7300 ...
$ Street.Prefix : chr "" "" "" "" ...
$ Street.Name : chr "AIRCRAFT" "SEVEN LOCKS" "CIRCLE" "STRATHMORE" ...
$ Street.Suffix : chr "" "" "" "" ...
$ Street.Type : chr "DR" "RD" "AVE" "AVE" ...
$ Latitude : num 39.2 39 39 39 39.1 ...
$ Longitude : num -77.3 -77.2 -77 -77.1 -77.1 ...
$ Police.District.Number: chr "5D" "2D" "TPPD" "2D" ...
$ Location : chr " (39.184, -77.2617)" " (39.012, -77.16)" " (38.9731, -77.0005)" " (39.0346, -77.1018)" ...
This shows me the dimensions of the dataset I will be working on.
head(Crimes, 10) Incident.ID Offence.Code CR.Number Dispatch.Date...Time
1 201573987 9105 260019565
2 201573985 9199 260019574
3 201573976 2999 260019562 05/06/2026 01:26:35 PM
4 201573971 9109 260019557 05/06/2026 12:26:24 PM
5 201573958 3700 260018359
6 201573957 3700 260018358
7 201573956 3700 260018357
8 201573955 3700 260018355
9 201573954 3700 260018354
10 201573953 3700 260018353
Start_Date_Time End_Date_Time NIBRS.Code Victims
1 05/06/2026 02:20:00 PM 05/06/2026 03:00:00 PM 90Z 1
2 05/06/2026 02:15:00 PM 90Z 1
3 05/06/2026 01:26:00 PM 290 1
4 05/06/2026 12:36:00 PM 05/06/2026 01:30:00 PM 90Z 1
5 05/06/2026 11:10:00 AM 370 1
6 05/06/2026 11:09:00 AM 370 1
7 05/06/2026 11:07:00 AM 370 1
8 05/06/2026 11:05:00 AM 370 1
9 05/06/2026 11:04:00 AM 370 1
10 05/06/2026 11:02:00 AM 370 1
Crime.Name1 Crime.Name2
1 Crime Against Society All Other Offenses
2 Crime Against Society All Other Offenses
3 Crime Against Property Destruction/Damage/Vandalism of Property
4 Crime Against Society All Other Offenses
5 Crime Against Society Pornography/Obscene Material
6 Crime Against Society Pornography/Obscene Material
7 Crime Against Society Pornography/Obscene Material
8 Crime Against Society Pornography/Obscene Material
9 Crime Against Society Pornography/Obscene Material
10 Crime Against Society Pornography/Obscene Material
Crime.Name3 Police.District.Name
1 LOST PROPERTY GERMANTOWN
2 POLICE INFORMATION BETHESDA
3 DAMAGE PROPERTY (DESCRIBE OFFENSE) TAKOMA PARK
4 RECOVERED PROPERTY - OTHER BETHESDA
5 OBSCENE MATERIAL ROCKVILLE
6 OBSCENE MATERIAL ROCKVILLE
7 OBSCENE MATERIAL ROCKVILLE
8 OBSCENE MATERIAL ROCKVILLE
9 OBSCENE MATERIAL ROCKVILLE
10 OBSCENE MATERIAL ROCKVILLE
Block.Address City State Zip.Code Agency
1 20000 BLK AIRCRAFT DR GERMANTOWN MD 20874 MCPD
2 9500 BLK SEVEN LOCKS RD BETHESDA MD 20817 MCPD
3 400 BLK CIRCLE AVE TAKOMA PARK MD 20912 TPPD
4 5100 BLK STRATHMORE AVE KENSINGTON MD 20895 MCPD
5 7300 BLK CALHOUN PL DERWOOD MD 20855 MCPD
6 7300 BLK CALHOUN PL DERWOOD MD 20855 MCPD
7 7300 BLK CALHOUN PL DERWOOD MD 20855 MCPD
8 7300 BLK CALHOUN PL DERWOOD MD 20855 MCPD
9 7300 BLK CALHOUN PL DERWOOD MD 20855 MCPD
10 7300 BLK CALHOUN PL DERWOOD MD 20855 MCPD
Place Sector Beat PRA Address.Number Street.Prefix
1 Street - Other N 5N1 702 20000
2 School - Elementary/Secondary E 2E2 207 9500
3 Construction Site T 8T3 808 400
4 Residence - Single Family D 2D1 694 5100
5 Other/Unknown A 1A1 281 7300
6 Other/Unknown A 1A1 281 7300
7 Other/Unknown A 1A1 281 7300
8 Other/Unknown A 1A1 281 7300
9 Other/Unknown A 1A1 281 7300
10 Other/Unknown A 1A1 281 7300
Street.Name Street.Suffix Street.Type Latitude Longitude
1 AIRCRAFT DR 39.18396 -77.2617
2 SEVEN LOCKS RD 39.01197 -77.1600
3 CIRCLE AVE 38.97314 -77.0005
4 STRATHMORE AVE 39.03455 -77.1018
5 CALHOUN PL 39.10762 -77.1466
6 CALHOUN PL 39.10762 -77.1466
7 CALHOUN PL 39.10762 -77.1466
8 CALHOUN PL 39.10762 -77.1466
9 CALHOUN PL 39.10762 -77.1466
10 CALHOUN PL 39.10762 -77.1466
Police.District.Number Location
1 5D (39.184, -77.2617)
2 2D (39.012, -77.16)
3 TPPD (38.9731, -77.0005)
4 2D (39.0346, -77.1018)
5 1D (39.1076, -77.1466)
6 1D (39.1076, -77.1466)
7 1D (39.1076, -77.1466)
8 1D (39.1076, -77.1466)
9 1D (39.1076, -77.1466)
10 1D (39.1076, -77.1466)
With me using the head function, I can see what I will need to fix. With that being the names of the variables.
names(Crimes) <- gsub("[\\$,\\.]","_",names(Crimes))Using this code chunk, I can fix the issue of the variables and get rid of the . and anything else. So the name of the variable won’t get in the way of me coding.
summary(Crimes) Incident_ID Offence_Code CR_Number
Min. :201087096 Length:491070 Min. : 10011074
1st Qu.:201207052 Class :character 1st Qu.:180046969
Median :201325660 Mode :character Median :210011468
Mean :201328019 Mean :195473655
3rd Qu.:201448337 3rd Qu.:230060011
Max. :201574019 Max. :260078173
Dispatch_Date___Time Start_Date_Time End_Date_Time NIBRS_Code
Length:491070 Length:491070 Length:491070 Length:491070
Class :character Class :character Class :character Class :character
Mode :character Mode :character Mode :character Mode :character
Victims Crime_Name1 Crime_Name2 Crime_Name3
Min. : 1.000 Length:491070 Length:491070 Length:491070
1st Qu.: 1.000 Class :character Class :character Class :character
Median : 1.000 Mode :character Mode :character Mode :character
Mean : 1.022
3rd Qu.: 1.000
Max. :22.000
Police_District_Name Block_Address City State
Length:491070 Length:491070 Length:491070 Length:491070
Class :character Class :character Class :character Class :character
Mode :character Mode :character Mode :character Mode :character
Zip_Code Agency Place Sector
Min. : 6 Length:491070 Length:491070 Length:491070
1st Qu.:20853 Class :character Class :character Class :character
Median :20878 Mode :character Mode :character Mode :character
Mean :20877
3rd Qu.:20904
Max. :29882
NA's :3442
Beat PRA Address_Number Street_Prefix
Length:491070 Length:491070 Min. : 0 Length:491070
Class :character Class :character 1st Qu.: 1600 Class :character
Mode :character Mode :character Median : 8100 Mode :character
Mean : 8352
3rd Qu.: 12400
Max. :2090600
NA's :38607
Street_Name Street_Suffix Street_Type Latitude
Length:491070 Length:491070 Length:491070 Min. : 0.00
Class :character Class :character Class :character 1st Qu.:39.02
Mode :character Mode :character Mode :character Median :39.07
Mean :37.32
3rd Qu.:39.14
Max. :39.35
Longitude Police_District_Number Location
Min. :-77.52 Length:491070 Length:491070
1st Qu.:-77.20 Class :character Class :character
Median :-77.10 Mode :character Mode :character
Mean :-73.64
3rd Qu.:-77.03
Max. : 0.00
This gives me the summary of the dataset, so I will be able to know what type of variables I will be working with.
crime_clean <- Crimes |>
select(Crime_Name1, Victims, City,
Police_District_Name,
Place, Sector, Beat) |>
filter(!is.na(Crime_Name1),
!is.na(Victims),
!is.na(City),
!is.na(Police_District_Name),
!is.na(Place),
!is.na(Sector),
!is.na(Beat))This code chunk does many things for me. it selects the variables I will be using for the regression, and getting rid of the na so I won’t have any issues involving nas in the future code.
Create Binary Response Variable
crime_clean <- crime_clean |>
mutate(property_crime = ifelse(Crime_Name1 ==
"Crime Against Property", 1, 0))And with this code, I mutate to create something new so I can use it for my regression. Where I am trying to find only for the results of Crime against property under the variable Crimes1 and use it.
Check Proportions
prop.table(table(crime_clean$property_crime))
0 1
0.5152219 0.4847781
This shows me the percent of Crime against property is in Crime1 and all the other crimes is all together.
Exploratory Visualization
crime_clean |>
ggplot(aes(x = Police_District_Name,
fill = factor(property_crime))) +
geom_bar(position = "dodge") +
labs(title = "Property Crimes by Police District",
x = "Police District",
y = "Count",
fill = "Property Crime") +
theme_minimal()This graph shows me the number of crimes against property per Police District. And every other crime is the 0.
str(crime_clean$property_crime) num [1:491070] 0 0 1 0 0 0 0 0 0 0 ...
Just double checking the variable.
Statistical Analysis
I will be doing Logistic Regression for my research question. I can’t do multiple regression as it needs continuous variables. And Logistic Regression will work the best as it requires binary and not continuous. And the other options doesn’t answer my questions. So I will be using Logistic Regression.
Logistic Regression Model
model <- glm(property_crime ~ Victims +
Police_District_Name+
Sector+ City
,
data = crime_clean,
family = binomial)Warning: glm.fit: algorithm did not converge
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
This is my Logistic regression equation that I put into the variable named model. And I used a few variables such as Sector, City, Police_District_Name and Victims for the equations.
summary(model)
Call:
glm(formula = property_crime ~ Victims + Police_District_Name +
Sector + City, family = binomial, data = crime_clean)
Coefficients: (5 not defined because of singularities)
Estimate Std. Error z value
(Intercept) 6.332e+13 1.503e+09 4.212e+04
Victims -2.843e+15 5.154e+05 -5.517e+09
Police_District_NameBETHESDA 2.780e+15 1.503e+09 1.849e+06
Police_District_NameGERMANTOWN 2.780e+15 1.503e+09 1.849e+06
Police_District_NameMONTGOMERY VILLAGE 2.780e+15 1.503e+09 1.849e+06
Police_District_NameOTHER 1.066e+04 5.529e-01 1.928e+04
Police_District_NameROCKVILLE 2.780e+15 1.503e+09 1.849e+06
Police_District_NameSILVER SPRING 2.780e+15 1.503e+09 1.849e+06
Police_District_NameTAKOMA PARK 2.780e+15 1.503e+09 1.849e+06
Police_District_NameWHEATON 2.780e+15 1.503e+09 1.849e+06
SectorB -4.741e+01 2.274e-02 -2.085e+03
SectorD 3.826e+00 1.790e-02 2.138e+02
SectorE NA NA NA
SectorG -4.638e+09 1.229e+05 -3.775e+04
SectorH -4.638e+09 1.229e+05 -3.775e+04
SectorI -4.638e+09 1.229e+05 -3.775e+04
SectorJ -4.469e-01 2.109e-02 -2.120e+01
SectorK 7.019e-01 1.601e-02 4.385e+01
SectorL NA NA NA
SectorM 1.027e+02 1.777e-02 5.781e+03
SectorN NA NA NA
SectorP 2.337e+01 1.698e-02 1.376e+03
SectorR NA NA NA
SectorT NA NA NA
Sectorw 2.780e+15 1.503e+09 1.849e+06
City0 1.918e+01 3.540e+05 0.000e+00
City1 8.135e+00 1.495e+00 5.442e+00
City2 -4.442e+01 2.493e+05 0.000e+00
City20850 -6.262e+01 3.488e+05 0.000e+00
City20877 4.310e+01 3.540e+05 0.000e+00
City3 -6.181e+01 3.488e+05 0.000e+00
City4 4.886e+01 2.482e+05 0.000e+00
City6 6.815e+01 1.251e+00 5.448e+01
City7 1.978e+01 3.540e+05 0.000e+00
CityAA 1.957e+01 3.540e+05 0.000e+00
CityADELPHI -4.639e+09 1.122e+05 -4.135e+04
CityALEXANDRIA -2.434e+01 2.502e+05 0.000e+00
CityALEXANDRIA AC 2.934e+01 2.535e+05 0.000e+00
CityALEXANDRIA FX -2.476e+01 2.502e+05 0.000e+00
CityAPENCERVILLE 9.815e+00 3.598e+05 0.000e+00
CityARLINGTON AC -2.475e+01 3.538e+05 0.000e+00
CityASHTON -1.702e+01 4.899e-01 -3.474e+01
CityASPEN HILL -1.880e+01 5.853e-01 -3.213e+01
CityBALTIMORE -1.642e+01 1.497e+00 -1.097e+01
CityBARNESVIILE 1.618e+02 3.589e+05 0.000e+00
CityBARNESVILLE 1.342e+02 5.441e-01 2.467e+02
CityBARNSVILLE 1.087e+02 1.767e+05 1.000e-03
CityBEALLSVILLE 1.190e+01 5.463e-01 2.179e+01
CityBEALSVILLE -1.462e+01 3.488e+05 0.000e+00
CityBEHESDA 5.639e+09 1.465e+05 3.848e+04
CityBEHTESDA -1.524e+01 1.317e+00 -1.157e+01
CityBELTSVILLE -1.531e+01 5.149e-01 -2.974e+01
CityBELTSVILLE PG 1.963e+00 1.494e+00 1.314e+00
CityBELTVILLE -2.393e+01 3.538e+05 0.000e+00
CityBETEHSDA -4.143e+01 3.509e+05 0.000e+00
CityBETESDA -1.670e+01 1.495e+00 -1.118e+01
CityBETHEDA -1.809e+01 1.033e+00 -1.752e+01
CityBETHESA -1.547e+01 1.317e+00 -1.174e+01
CityBETHESDA -1.569e+01 4.826e-01 -3.251e+01
CityBETHESDAS 7.655e+00 3.614e+05 0.000e+00
CityBETHSDA -1.462e+01 1.494e+00 -9.781e+00
CityBOWIE 4.351e+01 3.540e+05 0.000e+00
CityBOYDS 1.100e+02 4.859e-01 2.264e+02
CityBRENTWOOD -2.390e+01 3.538e+05 0.000e+00
CityBRINKLOW -1.723e+01 5.186e-01 -3.322e+01
CityBROOKEVILLE -1.647e+01 4.855e-01 -3.393e+01
CityBROOKVILLE -1.267e+01 8.420e-01 -1.505e+01
CityBURTONSVILE -4.390e+01 3.492e+05 0.000e+00
CityBURTONSVILLE -1.760e+01 4.831e-01 -3.642e+01
CityBURTOSNVILLE 9.670e+00 3.632e+05 0.000e+00
CityBURTSONVILLE -4.359e+01 2.469e+05 0.000e+00
CityBUTINSVILLE 9.837e+00 3.632e+05 0.000e+00
CityCABIN JOHN -1.404e+01 4.960e-01 -2.832e+01
CityCALARKSBURG 5.919e+01 3.589e+05 0.000e+00
CityCAPITOL HEIGHTS -4.339e+01 3.492e+05 0.000e+00
CityCC -4.381e+01 3.492e+05 0.000e+00
CityCEHVY CHASE 1.155e+01 2.556e+05 0.000e+00
CityCERWOOD 4.347e+01 3.540e+05 0.000e+00
CityCHAVEY CAHSE -1.837e+01 1.494e+00 -1.230e+01
CityCHEVY CAHSE 8.642e-01 7.005e-01 1.234e+00
CityCHEVY CHASE -1.657e+01 4.829e-01 -3.432e+01
CityCHEVY CHASE #3 -4.514e+01 3.509e+05 0.000e+00
CityCHEVY CHASE #4 -1.711e+01 1.219e+00 -1.404e+01
CityCHEVY CHASE VIEW -4.540e+01 3.509e+05 0.000e+00
CityCHEVY CHASE VILLAGE 1.183e+01 3.614e+05 0.000e+00
CityCHEY CHASE -4.546e+01 3.509e+05 0.000e+00
CityCHVEY CHASE -4.479e+01 3.509e+05 0.000e+00
CityCLAEKSBURG 6.144e+00 3.534e+05 0.000e+00
CityCLARKESBURG 3.151e+01 1.316e+00 2.394e+01
CityCLARKSBUG 6.665e+00 3.534e+05 0.000e+00
CityCLARKSBURG 6.236e+01 4.840e-01 1.288e+02
CityCLARKSURG 6.317e+00 1.443e+05 0.000e+00
CityCLARKSVILLE HC -2.434e+01 3.538e+05 0.000e+00
CityCLARSBURG 6.279e+00 3.534e+05 0.000e+00
CityCLARSKBURG 5.896e+01 3.589e+05 0.000e+00
CityCOLESVILLE -1.815e+01 9.491e-01 -1.912e+01
CityCOLLEGE PARK 1.662e+00 1.494e+00 1.112e+00
CityCOLUMBIA -8.935e+00 3.636e+05 0.000e+00
CityCOLUMBIA HC 2.038e+01 3.585e+05 0.000e+00
CityCOMUS 1.618e+02 2.538e+05 1.000e-03
CityDAMASCUS 3.208e+01 4.845e-01 6.622e+01
CityDANASCUS 4.827e+01 3.589e+05 0.000e+00
CityDARNESTOWN 1.772e+01 5.959e-01 2.973e+01
CityDEERWOOD 1.975e+01 3.540e+05 0.000e+00
CityDEROOD 4.334e+01 3.540e+05 0.000e+00
CityDERWOOD 2.920e+02 4.829e-01 6.046e+02
CityDICKERSON 7.912e+01 4.926e-01 1.606e+02
CityDISTRICT OF COLUMBIA -4.404e+01 3.492e+05 0.000e+00
CityEMMITSBURG FC 2.934e+01 3.585e+05 0.000e+00
CityFAIRFAX -2.473e+01 3.538e+05 0.000e+00
CityFAIRFAX FX -2.474e+01 2.502e+05 0.000e+00
CityFALLS CHURCH 1.662e+00 1.494e+00 1.112e+00
CityFINKSBURG CC -2.472e+01 3.538e+05 0.000e+00
CityFOREST HEIGHTS 1.177e+01 3.614e+05 0.000e+00
CityFREDERICK 9.321e+00 3.598e+05 0.000e+00
CityFRIENDHSIP HEIGHTS -1.541e+01 1.316e+00 -1.171e+01
CityFRIENDSHIP HEIGHTS -1.446e+01 9.366e-01 -1.544e+01
CityFT MEADE -4.349e+01 3.525e+05 0.000e+00
CityGA 5.206e+01 5.181e-01 1.005e+02
CityGAIHERSBURG 9.607e+01 3.582e+05 0.000e+00
CityGAIHTERSBURG 2.011e+01 3.540e+05 0.000e+00
CityGAISTHERSBURG 1.909e+01 3.540e+05 0.000e+00
CityGAITEHRSBURG 4.415e+01 1.316e+00 3.355e+01
CityGAITERSBURG 6.010e+01 1.032e+00 5.821e+01
CityGAITHERBSURG 1.964e+01 2.503e+05 0.000e+00
CityGAITHERBURG 5.157e+01 6.796e-01 7.588e+01
CityGAITHERESBURG 4.547e+01 1.032e+00 4.405e+01
CityGAITHERS BURG 1.945e+01 3.540e+05 0.000e+00
CityGAITHERSBRG 4.262e+01 3.540e+05 0.000e+00
CityGAITHERSBRUG 6.733e+01 1.198e+00 5.621e+01
CityGAITHERSBUG 1.637e+01 1.768e+05 0.000e+00
CityGAITHERSBUIRG 9.591e+01 3.582e+05 0.000e+00
CityGAITHERSBURB 1.941e+01 3.540e+05 0.000e+00
CityGAITHERSBURD -6.179e+01 3.488e+05 0.000e+00
CityGAITHERSBURG 4.919e+01 4.825e-01 1.019e+02
CityGAITHERSBURG` 1.983e+01 3.540e+05 0.000e+00
CityGAITHERSBURGQ 1.979e+01 3.540e+05 0.000e+00
CityGAITHERSBURRG 1.984e+01 3.540e+05 0.000e+00
CityGAITHERSBURT 9.620e+01 3.582e+05 0.000e+00
CityGAITHERSBYRG 1.954e+01 3.540e+05 0.000e+00
CityGAITHERSGURG 5.112e+01 1.251e+00 4.087e+01
CityGAITHERSRBURG 5.805e+01 1.494e+00 3.884e+01
CityGAITHERSSBURG 4.353e+01 3.540e+05 0.000e+00
CityGAITHERSURG 3.186e+01 2.503e+05 0.000e+00
CityGAITHESBURG 5.965e+01 9.036e-01 6.602e+01
CityGAITHESRBURG 5.806e+01 1.110e+00 5.229e+01
CityGAITHRERSBURG 4.324e+01 3.540e+05 0.000e+00
CityGAITHRESBURG 2.037e+01 2.503e+05 0.000e+00
CityGARETT PARK -4.522e+01 3.509e+05 0.000e+00
CityGARRETT PARK -1.816e+01 5.047e-01 -3.598e+01
CityGATHERSBURG 1.972e+01 3.540e+05 0.000e+00
CityGATIHERSBURG 5.989e+01 1.182e+00 5.066e+01
CityGAUTHERSBURG 4.323e+01 3.540e+05 0.000e+00
CityGEERMANTOWN 5.906e+01 3.589e+05 0.000e+00
CityGEMANTOWN 1.088e+02 1.217e+00 8.942e+01
CityGERAMNTOWN 1.616e+02 3.589e+05 0.000e+00
CityGERANTOWN 5.966e+01 3.589e+05 0.000e+00
CityGERMAN4TOWN 6.265e+00 3.534e+05 0.000e+00
CityGERMANOTWN 7.778e+01 3.534e+05 0.000e+00
CityGERMANTIWN 1.618e+02 3.589e+05 0.000e+00
CityGERMANTNOWN 5.643e+00 3.534e+05 0.000e+00
CityGERMANTOEN 1.616e+02 3.589e+05 0.000e+00
CityGERMANTONW 1.090e+02 2.499e+05 0.000e+00
CityGERMANTOOWN 5.910e+01 3.589e+05 0.000e+00
CityGERMANTOW 1.088e+02 2.040e+05 1.000e-03
CityGERMANTOWM 1.619e+02 2.538e+05 1.000e-03
CityGERMANTOWN 2.185e+01 4.835e-01 4.520e+01
CityGERMANTOWNMD 1.085e+02 3.534e+05 0.000e+00
CityGERMANTOWNN 6.116e+00 3.534e+05 0.000e+00
CityGERMANTWN 5.609e+00 3.534e+05 0.000e+00
CityGERMANTWON 3.314e+01 1.434e+05 0.000e+00
CityGERMATOWN 1.047e+02 7.818e-01 1.339e+02
CityGERMNATOWN 1.193e+02 2.521e+05 0.000e+00
CityGERMNTOWN 6.340e+01 1.319e+00 4.805e+01
CityGERRMANTOWN 1.089e+02 3.534e+05 0.000e+00
CityGIATHERSBURG 4.984e+01 1.164e+00 4.281e+01
CityGITHERSBURG -5.288e+00 2.483e+05 0.000e+00
CityGLEN ECHO -1.338e+01 5.340e-01 -2.505e+01
CityGLEN ECHO` 1.205e+01 3.614e+05 0.000e+00
CityGLENMONT -4.425e+01 2.493e+05 0.000e+00
CityGREENBELT 7.309e+01 3.582e+05 0.000e+00
CityGRMANTOWN 1.090e+02 3.534e+05 0.000e+00
CityHAGERSTOWN 4.319e+01 3.540e+05 0.000e+00
CityHERNDON 3.199e+00 1.316e+00 2.430e+00
CityHIGHLAND -1.756e+01 7.068e-01 -2.484e+01
CityHYATTSTOWN 5.836e+00 2.040e+05 0.000e+00
CityHYATTSVILLE -7.521e+00 5.757e-01 -1.306e+01
CityHYATTSVILLE PG -1.718e+00 7.129e-01 -2.409e+00
CityHYATTTOWN 5.723e+00 3.534e+05 0.000e+00
CityKE -1.832e+01 1.494e+00 -1.226e+01
CityKENNSINGTON -4.524e+01 3.509e+05 0.000e+00
CityKENSIGNTON 7.992e+00 3.614e+05 0.000e+00
CityKENSINGTNO -4.445e+01 3.509e+05 0.000e+00
CityKENSINGTON -9.034e+00 4.829e-01 -1.871e+01
CityKENSINGTOWN 7.809e+00 3.614e+05 0.000e+00
CityKENSINNGTON -4.385e+01 3.525e+05 0.000e+00
CityKENSONGTON 7.862e+00 3.614e+05 0.000e+00
CityKENSTINGTON -4.364e+01 3.525e+05 0.000e+00
CityLA 3.240e+01 1.495e+00 2.168e+01
CityLANHAM 1.127e+01 9.501e-01 1.187e+01
CityLATONSVILLE 5.967e+01 2.538e+05 0.000e+00
CityLAUREL -1.360e+01 5.421e-01 -2.508e+01
CityLAUREL AA 2.852e+01 3.585e+05 0.000e+00
CityLAUREL HC -2.349e+01 3.538e+05 0.000e+00
CityLAUREL PG -2.393e+01 3.538e+05 0.000e+00
CityLAYTENSVILLE 6.004e+00 3.534e+05 0.000e+00
CityLAYTONSVILLE 3.371e+01 5.676e-01 5.938e+01
CityMARYLAND 7.708e+00 3.614e+05 0.000e+00
CityMCG 1.193e+01 4.944e-01 2.414e+01
CityMCGGAITHERSBURG 3.722e+01 3.540e+05 0.000e+00
CityMCLEAN 1.662e+00 1.110e+00 1.497e+00
CityMD -1.537e+01 2.478e+05 0.000e+00
CityMOMTGOMERY VILLAGE -1.660e+15 6.711e+07 -2.474e+07
CityMONGTOMERY VILLAGE 9.606e+01 3.582e+05 0.000e+00
CityMONROVIA 3.239e+01 1.495e+00 2.167e+01
CityMONROVIA FC -2.518e+01 3.538e+05 0.000e+00
CityMONT VILLAGE 9.617e+01 3.582e+05 0.000e+00
CityMONTGGOMERY VILLAGE 4.279e+01 3.540e+05 0.000e+00
CityMONTGOMERY 2.529e+01 1.111e+00 2.277e+01
CityMONTGOMERY COUNTY 3.418e+01 9.269e-01 3.688e+01
CityMONTGOMERY VILAGE 7.007e+01 1.110e+00 6.310e+01
CityMONTGOMERY VILLAE 9.635e+01 3.582e+05 0.000e+00
CityMONTGOMERY VILLAGE 6.971e+01 4.829e-01 1.444e+02
CityMONTGOMERY VILLLAGE 4.303e+01 3.540e+05 0.000e+00
CityMONTGOMRY VILLAGE 9.642e+01 3.582e+05 0.000e+00
CityMONTHOMERY VILLAGE 4.289e+01 3.540e+05 0.000e+00
CityMONTOMGERY VILLAGE 9.601e+01 3.582e+05 0.000e+00
CityMOTGOMERY VILLAGE 4.339e+01 2.044e+05 0.000e+00
CityMOUNT AIRTY -2.393e+01 3.538e+05 0.000e+00
CityMOUNT AIRY 3.199e+01 5.851e-01 5.467e+01
CityMOUNT RAINIER -2.476e+01 3.538e+05 0.000e+00
CityMT AIRY 3.043e+01 5.419e-01 5.616e+01
CityMT. AIRY 3.116e+01 1.196e+00 2.605e+01
CityMT. AIRY FC 2.934e+01 3.585e+05 0.000e+00
CityN BETHESDA -1.750e+01 9.010e-01 -1.942e+01
CityN BETHESDAQ 1.152e+01 3.614e+05 0.000e+00
CityN POTOMAC 1.231e+01 7.007e-01 1.757e+01
CityN. BETHESDA 7.999e+00 3.614e+05 0.000e+00
CityN. POTOMAC 3.889e+01 2.571e+05 0.000e+00
CityNEW MARKET -2.392e+01 3.538e+05 0.000e+00
CityNORTH BEHTESDA -2.372e+01 3.614e+05 0.000e+00
CityNORTH BETHESDA -1.909e+01 5.316e-01 -3.592e+01
CityNORTH BETHESDA` -4.528e+01 3.509e+05 0.000e+00
CityNORTH BETHSDA 7.901e+00 3.614e+05 0.000e+00
CityNORTH CHEVY CHASE -4.536e+01 3.509e+05 0.000e+00
CityNORTH POTOAMC 1.224e+01 1.494e+00 8.190e+00
CityNORTH POTOMAC 1.261e+01 5.099e-01 2.473e+01
CityNOTRTH POTOMAC 3.913e+01 3.636e+05 0.000e+00
CityOLNEY -1.600e+01 4.832e-01 -3.311e+01
CityONEY 1.310e+00 3.598e+05 0.000e+00
CityONLEY 9.692e+00 2.544e+05 0.000e+00
CityOXON HILL 8.972e+00 2.568e+05 0.000e+00
CityPO 1.318e+01 8.567e-01 1.538e+01
CityPOOLESVILLE 1.239e+01 4.856e-01 2.551e+01
CityPOOLSVILLE 1.314e+01 1.318e+00 9.972e+00
CityPOTIMAC 3.807e+01 3.636e+05 0.000e+00
CityPOTOMAC 3.531e+00 4.829e-01 7.312e+00
CityPRINCE GEORGES COUNTY 2.335e+01 3.538e+05 0.000e+00
CityRCKVILLE -1.663e+01 3.488e+05 0.000e+00
CityREDLAND 3.223e+01 1.770e+05 0.000e+00
CityRIVERDALE -2.435e+01 3.538e+05 0.000e+00
CityRIVERDALE PG 2.935e+01 2.535e+05 0.000e+00
CityRO -3.247e+01 5.806e-01 -5.593e+01
CityROCK VILLE -6.196e+01 3.488e+05 0.000e+00
CityROCKILLE -2.232e+01 9.909e-01 -2.252e+01
CityROCKIVILLE 8.005e+00 3.614e+05 0.000e+00
CityROCKIVLLE -6.152e+01 2.466e+05 0.000e+00
CityROCKVIILE -3.505e+01 1.494e+00 -2.346e+01
CityROCKVIILLE 5.561e+00 1.494e+00 3.721e+00
CityROCKVILE -1.365e+01 7.244e-01 -1.884e+01
CityROCKVILEE -4.528e+01 3.509e+05 0.000e+00
CityROCKVILL 7.678e+00 3.614e+05 0.000e+00
CityROCKVILLE -2.266e+01 4.823e-01 -4.699e+01
CityROCKVILLE' 7.957e+00 3.614e+05 0.000e+00
CityROCKVILLE, -8.796e+00 3.636e+05 0.000e+00
CityROCKVILLLE -3.198e+01 1.252e+00 -2.554e+01
CityROCKVLLE 8.634e+09 1.813e+05 4.762e+04
CityROCVILLE -2.345e+01 1.111e+00 -2.111e+01
CityROCVKILLE 9.756e+00 3.598e+05 0.000e+00
CityROKVILLE -2.578e+00 1.316e+00 -1.959e+00
CityROKVILLLE -4.424e+01 3.525e+05 0.000e+00
CityROOCKVILLE 8.155e+00 3.614e+05 0.000e+00
CitySANDY SPPRING 1.004e+01 3.598e+05 0.000e+00
CitySANDY SPRING -1.702e+01 4.882e-01 -3.487e+01
CitySILER SPRING -1.865e+01 1.251e+00 -1.491e+01
CitySILV ER SPRING -4.432e+01 3.492e+05 0.000e+00
CitySILVE SPRING -1.748e+01 1.112e+00 -1.572e+01
CitySILVE4R SPRING 9.290e+00 3.632e+05 0.000e+00
CitySILVER -1.734e+01 9.504e-01 -1.824e+01
CitySILVER SPRING -1.876e+01 1.218e+00 -1.540e+01
CitySILVER APRING -4.403e+01 3.492e+05 0.000e+00
CitySILVER SPING -1.685e+01 8.757e-01 -1.925e+01
CitySILVER SPIRNG -4.357e+01 3.492e+05 0.000e+00
CitySILVER SPRIG -1.798e+01 1.498e+00 -1.200e+01
CitySILVER SPRIGN 9.273e+00 3.598e+05 0.000e+00
CitySILVER SPRIING 9.893e+00 3.598e+05 0.000e+00
CitySILVER SPRIN -1.745e+01 1.112e+00 -1.569e+01
CitySILVER SPRIN G -4.362e+01 3.492e+05 0.000e+00
CitySILVER SPRIND 9.633e+00 2.568e+05 0.000e+00
CitySILVER SPRING -1.747e+01 4.823e-01 -3.622e+01
CitySILVER SPRING PG 2.588e+00 1.494e+00 1.732e+00
CitySILVER SPRING` -1.682e+01 1.316e+00 -1.278e+01
CitySILVER SPRINGQ -4.413e+01 2.479e+05 0.000e+00
CitySILVER SPRNG -1.723e+01 8.272e-01 -2.083e+01
CitySILVER SPRNIG 8.947e+00 3.632e+05 0.000e+00
CitySILVER SPSRING 9.871e+00 3.632e+05 0.000e+00
CitySILVER SRING -1.809e+01 8.569e-01 -2.111e+01
CitySILVER SRPING -1.857e+01 9.487e-01 -1.957e+01
CitySILVER SRRING -4.443e+01 3.492e+05 0.000e+00
CitySILVERS SPRING -4.367e+01 3.525e+05 0.000e+00
CitySILVERSPRING -1.831e+01 8.430e-01 -2.172e+01
CitySILVR SPRING -1.741e+01 1.112e+00 -1.566e+01
CitySIVER SPRING -1.681e+01 9.047e-01 -1.858e+01
CitySIVLER SPRING -1.709e+01 1.033e+00 -1.655e+01
CitySLIVER SPRING 8.888e+00 3.632e+05 0.000e+00
CitySLVER SPRING 8.759e+00 2.537e+05 0.000e+00
CitySPENCERVILLE -1.763e+01 5.020e-01 -3.512e+01
CityTACOMA PARK -7.427e+01 1.321e+00 -5.622e+01
CityTAKOMA -4.353e+01 3.492e+05 0.000e+00
CityTAKOMA PARK -4.924e+00 4.837e-01 -1.018e+01
CityTAKOMA PARK PG -2.474e+01 2.502e+05 0.000e+00
CityTAKOMS PARK -7.084e+01 3.547e+05 0.000e+00
CityTANEYTOWN -2.309e+01 3.538e+05 0.000e+00
CityTEMPLE HILLS PG -2.434e+01 2.502e+05 0.000e+00
CityTP -9.737e+01 4.916e-01 -1.981e+02
CityVALLEYWOOD 9.032e+00 3.598e+05 0.000e+00
CityVIENNA -2.433e+01 3.538e+05 0.000e+00
CityWASHINGTON -5.430e+00 5.995e-01 -9.057e+00
CityWASHINGTON DC 1.034e+00 7.435e-01 1.391e+00
CityWASHINGTON GROVE 4.602e+01 5.252e-01 8.763e+01
CityWEATON 1.045e+01 3.598e+05 0.000e+00
CityWEHATON 9.561e+00 3.598e+05 0.000e+00
CityWEST FRIENDSHIP -2.392e+01 3.538e+05 0.000e+00
CityWHEATON -1.798e+01 4.869e-01 -3.693e+01
CityWHITE OAK 9.295e+00 3.632e+05 0.000e+00
CityWOODBINE 3.219e+01 9.038e-01 3.561e+01
Pr(>|z|)
(Intercept) < 2e-16 ***
Victims < 2e-16 ***
Police_District_NameBETHESDA < 2e-16 ***
Police_District_NameGERMANTOWN < 2e-16 ***
Police_District_NameMONTGOMERY VILLAGE < 2e-16 ***
Police_District_NameOTHER < 2e-16 ***
Police_District_NameROCKVILLE < 2e-16 ***
Police_District_NameSILVER SPRING < 2e-16 ***
Police_District_NameTAKOMA PARK < 2e-16 ***
Police_District_NameWHEATON < 2e-16 ***
SectorB < 2e-16 ***
SectorD < 2e-16 ***
SectorE NA
SectorG < 2e-16 ***
SectorH < 2e-16 ***
SectorI < 2e-16 ***
SectorJ < 2e-16 ***
SectorK < 2e-16 ***
SectorL NA
SectorM < 2e-16 ***
SectorN NA
SectorP < 2e-16 ***
SectorR NA
SectorT NA
Sectorw < 2e-16 ***
City0 0.999957
City1 5.26e-08 ***
City2 0.999858
City20850 0.999857
City20877 0.999903
City3 0.999859
City4 0.999843
City6 < 2e-16 ***
City7 0.999955
CityAA 0.999956
CityADELPHI < 2e-16 ***
CityALEXANDRIA 0.999922
CityALEXANDRIA AC 0.999908
CityALEXANDRIA FX 0.999921
CityAPENCERVILLE 0.999978
CityARLINGTON AC 0.999944
CityASHTON < 2e-16 ***
CityASPEN HILL < 2e-16 ***
CityBALTIMORE < 2e-16 ***
CityBARNESVIILE 0.999640
CityBARNESVILLE < 2e-16 ***
CityBARNSVILLE 0.999509
CityBEALLSVILLE < 2e-16 ***
CityBEALSVILLE 0.999967
CityBEHESDA < 2e-16 ***
CityBEHTESDA < 2e-16 ***
CityBELTSVILLE < 2e-16 ***
CityBELTSVILLE PG 0.188774
CityBELTVILLE 0.999946
CityBETEHSDA 0.999906
CityBETESDA < 2e-16 ***
CityBETHEDA < 2e-16 ***
CityBETHESA < 2e-16 ***
CityBETHESDA < 2e-16 ***
CityBETHESDAS 0.999983
CityBETHSDA < 2e-16 ***
CityBOWIE 0.999902
CityBOYDS < 2e-16 ***
CityBRENTWOOD 0.999946
CityBRINKLOW < 2e-16 ***
CityBROOKEVILLE < 2e-16 ***
CityBROOKVILLE < 2e-16 ***
CityBURTONSVILE 0.999900
CityBURTONSVILLE < 2e-16 ***
CityBURTOSNVILLE 0.999979
CityBURTSONVILLE 0.999859
CityBUTINSVILLE 0.999978
CityCABIN JOHN < 2e-16 ***
CityCALARKSBURG 0.999868
CityCAPITOL HEIGHTS 0.999901
CityCC 0.999900
CityCEHVY CHASE 0.999964
CityCERWOOD 0.999902
CityCHAVEY CAHSE < 2e-16 ***
CityCHEVY CAHSE 0.217301
CityCHEVY CHASE < 2e-16 ***
CityCHEVY CHASE #3 0.999897
CityCHEVY CHASE #4 < 2e-16 ***
CityCHEVY CHASE VIEW 0.999897
CityCHEVY CHASE VILLAGE 0.999974
CityCHEY CHASE 0.999897
CityCHVEY CHASE 0.999898
CityCLAEKSBURG 0.999986
CityCLARKESBURG < 2e-16 ***
CityCLARKSBUG 0.999985
CityCLARKSBURG < 2e-16 ***
CityCLARKSURG 0.999965
CityCLARKSVILLE HC 0.999945
CityCLARSBURG 0.999986
CityCLARSKBURG 0.999869
CityCOLESVILLE < 2e-16 ***
CityCOLLEGE PARK 0.265995
CityCOLUMBIA 0.999980
CityCOLUMBIA HC 0.999955
CityCOMUS 0.999491
CityDAMASCUS < 2e-16 ***
CityDANASCUS 0.999893
CityDARNESTOWN < 2e-16 ***
CityDEERWOOD 0.999955
CityDEROOD 0.999902
CityDERWOOD < 2e-16 ***
CityDICKERSON < 2e-16 ***
CityDISTRICT OF COLUMBIA 0.999899
CityEMMITSBURG FC 0.999935
CityFAIRFAX 0.999944
CityFAIRFAX FX 0.999921
CityFALLS CHURCH 0.265996
CityFINKSBURG CC 0.999944
CityFOREST HEIGHTS 0.999974
CityFREDERICK 0.999979
CityFRIENDHSIP HEIGHTS < 2e-16 ***
CityFRIENDSHIP HEIGHTS < 2e-16 ***
CityFT MEADE 0.999902
CityGA < 2e-16 ***
CityGAIHERSBURG 0.999786
CityGAIHTERSBURG 0.999955
CityGAISTHERSBURG 0.999957
CityGAITEHRSBURG < 2e-16 ***
CityGAITERSBURG < 2e-16 ***
CityGAITHERBSURG 0.999937
CityGAITHERBURG < 2e-16 ***
CityGAITHERESBURG < 2e-16 ***
CityGAITHERS BURG 0.999956
CityGAITHERSBRG 0.999904
CityGAITHERSBRUG < 2e-16 ***
CityGAITHERSBUG 0.999926
CityGAITHERSBUIRG 0.999786
CityGAITHERSBURB 0.999956
CityGAITHERSBURD 0.999859
CityGAITHERSBURG < 2e-16 ***
CityGAITHERSBURG` 0.999955
CityGAITHERSBURGQ 0.999955
CityGAITHERSBURRG 0.999955
CityGAITHERSBURT 0.999786
CityGAITHERSBYRG 0.999956
CityGAITHERSGURG < 2e-16 ***
CityGAITHERSRBURG < 2e-16 ***
CityGAITHERSSBURG 0.999902
CityGAITHERSURG 0.999898
CityGAITHESBURG < 2e-16 ***
CityGAITHESRBURG < 2e-16 ***
CityGAITHRERSBURG 0.999903
CityGAITHRESBURG 0.999935
CityGARETT PARK 0.999897
CityGARRETT PARK < 2e-16 ***
CityGATHERSBURG 0.999956
CityGATIHERSBURG < 2e-16 ***
CityGAUTHERSBURG 0.999903
CityGEERMANTOWN 0.999869
CityGEMANTOWN < 2e-16 ***
CityGERAMNTOWN 0.999641
CityGERANTOWN 0.999867
CityGERMAN4TOWN 0.999986
CityGERMANOTWN 0.999824
CityGERMANTIWN 0.999640
CityGERMANTNOWN 0.999987
CityGERMANTOEN 0.999641
CityGERMANTONW 0.999652
CityGERMANTOOWN 0.999869
CityGERMANTOW 0.999574
CityGERMANTOWM 0.999491
CityGERMANTOWN < 2e-16 ***
CityGERMANTOWNMD 0.999755
CityGERMANTOWNN 0.999986
CityGERMANTWN 0.999987
CityGERMANTWON 0.999816
CityGERMATOWN < 2e-16 ***
CityGERMNATOWN 0.999623
CityGERMNTOWN < 2e-16 ***
CityGERRMANTOWN 0.999754
CityGIATHERSBURG < 2e-16 ***
CityGITHERSBURG 0.999983
CityGLEN ECHO < 2e-16 ***
CityGLEN ECHO` 0.999973
CityGLENMONT 0.999858
CityGREENBELT 0.999837
CityGRMANTOWN 0.999754
CityHAGERSTOWN 0.999903
CityHERNDON 0.015083 *
CityHIGHLAND < 2e-16 ***
CityHYATTSTOWN 0.999977
CityHYATTSVILLE < 2e-16 ***
CityHYATTSVILLE PG 0.015984 *
CityHYATTTOWN 0.999987
CityKE < 2e-16 ***
CityKENNSINGTON 0.999897
CityKENSIGNTON 0.999982
CityKENSINGTNO 0.999899
CityKENSINGTON < 2e-16 ***
CityKENSINGTOWN 0.999983
CityKENSINNGTON 0.999901
CityKENSONGTON 0.999983
CityKENSTINGTON 0.999901
CityLA < 2e-16 ***
CityLANHAM < 2e-16 ***
CityLATONSVILLE 0.999812
CityLAUREL < 2e-16 ***
CityLAUREL AA 0.999937
CityLAUREL HC 0.999947
CityLAUREL PG 0.999946
CityLAYTENSVILLE 0.999986
CityLAYTONSVILLE < 2e-16 ***
CityMARYLAND 0.999983
CityMCG < 2e-16 ***
CityMCGGAITHERSBURG 0.999916
CityMCLEAN 0.134336
CityMD 0.999951
CityMOMTGOMERY VILLAGE < 2e-16 ***
CityMONGTOMERY VILLAGE 0.999786
CityMONROVIA < 2e-16 ***
CityMONROVIA FC 0.999943
CityMONT VILLAGE 0.999786
CityMONTGGOMERY VILLAGE 0.999904
CityMONTGOMERY < 2e-16 ***
CityMONTGOMERY COUNTY < 2e-16 ***
CityMONTGOMERY VILAGE < 2e-16 ***
CityMONTGOMERY VILLAE 0.999785
CityMONTGOMERY VILLAGE < 2e-16 ***
CityMONTGOMERY VILLLAGE 0.999903
CityMONTGOMRY VILLAGE 0.999785
CityMONTHOMERY VILLAGE 0.999903
CityMONTOMGERY VILLAGE 0.999786
CityMOTGOMERY VILLAGE 0.999831
CityMOUNT AIRTY 0.999946
CityMOUNT AIRY < 2e-16 ***
CityMOUNT RAINIER 0.999944
CityMT AIRY < 2e-16 ***
CityMT. AIRY < 2e-16 ***
CityMT. AIRY FC 0.999935
CityN BETHESDA < 2e-16 ***
CityN BETHESDAQ 0.999975
CityN POTOMAC < 2e-16 ***
CityN. BETHESDA 0.999982
CityN. POTOMAC 0.999879
CityNEW MARKET 0.999946
CityNORTH BEHTESDA 0.999948
CityNORTH BETHESDA < 2e-16 ***
CityNORTH BETHESDA` 0.999897
CityNORTH BETHSDA 0.999983
CityNORTH CHEVY CHASE 0.999897
CityNORTH POTOAMC 2.62e-16 ***
CityNORTH POTOMAC < 2e-16 ***
CityNOTRTH POTOMAC 0.999914
CityOLNEY < 2e-16 ***
CityONEY 0.999997
CityONLEY 0.999970
CityOXON HILL 0.999972
CityPO < 2e-16 ***
CityPOOLESVILLE < 2e-16 ***
CityPOOLSVILLE < 2e-16 ***
CityPOTIMAC 0.999916
CityPOTOMAC 2.64e-13 ***
CityPRINCE GEORGES COUNTY 0.999947
CityRCKVILLE 0.999962
CityREDLAND 0.999855
CityRIVERDALE 0.999945
CityRIVERDALE PG 0.999908
CityRO < 2e-16 ***
CityROCK VILLE 0.999858
CityROCKILLE < 2e-16 ***
CityROCKIVILLE 0.999982
CityROCKIVLLE 0.999801
CityROCKVIILE < 2e-16 ***
CityROCKVIILLE 0.000199 ***
CityROCKVILE < 2e-16 ***
CityROCKVILEE 0.999897
CityROCKVILL 0.999983
CityROCKVILLE < 2e-16 ***
CityROCKVILLE' 0.999982
CityROCKVILLE, 0.999981
CityROCKVILLLE < 2e-16 ***
CityROCKVLLE < 2e-16 ***
CityROCVILLE < 2e-16 ***
CityROCVKILLE 0.999978
CityROKVILLE 0.050094 .
CityROKVILLLE 0.999900
CityROOCKVILLE 0.999982
CitySANDY SPPRING 0.999978
CitySANDY SPRING < 2e-16 ***
CitySILER SPRING < 2e-16 ***
CitySILV ER SPRING 0.999899
CitySILVE SPRING < 2e-16 ***
CitySILVE4R SPRING 0.999980
CitySILVER < 2e-16 ***
CitySILVER SPRING < 2e-16 ***
CitySILVER APRING 0.999899
CitySILVER SPING < 2e-16 ***
CitySILVER SPIRNG 0.999900
CitySILVER SPRIG < 2e-16 ***
CitySILVER SPRIGN 0.999979
CitySILVER SPRIING 0.999978
CitySILVER SPRIN < 2e-16 ***
CitySILVER SPRIN G 0.999900
CitySILVER SPRIND 0.999970
CitySILVER SPRING < 2e-16 ***
CitySILVER SPRING PG 0.083256 .
CitySILVER SPRING` < 2e-16 ***
CitySILVER SPRINGQ 0.999858
CitySILVER SPRNG < 2e-16 ***
CitySILVER SPRNIG 0.999980
CitySILVER SPSRING 0.999978
CitySILVER SRING < 2e-16 ***
CitySILVER SRPING < 2e-16 ***
CitySILVER SRRING 0.999898
CitySILVERS SPRING 0.999901
CitySILVERSPRING < 2e-16 ***
CitySILVR SPRING < 2e-16 ***
CitySIVER SPRING < 2e-16 ***
CitySIVLER SPRING < 2e-16 ***
CitySLIVER SPRING 0.999980
CitySLVER SPRING 0.999972
CitySPENCERVILLE < 2e-16 ***
CityTACOMA PARK < 2e-16 ***
CityTAKOMA 0.999901
CityTAKOMA PARK < 2e-16 ***
CityTAKOMA PARK PG 0.999921
CityTAKOMS PARK 0.999841
CityTANEYTOWN 0.999948
CityTEMPLE HILLS PG 0.999922
CityTP < 2e-16 ***
CityVALLEYWOOD 0.999980
CityVIENNA 0.999945
CityWASHINGTON < 2e-16 ***
CityWASHINGTON DC 0.164136
CityWASHINGTON GROVE < 2e-16 ***
CityWEATON 0.999977
CityWEHATON 0.999979
CityWEST FRIENDSHIP 0.999946
CityWHEATON < 2e-16 ***
CityWHITE OAK 0.999980
CityWOODBINE < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 680312 on 491069 degrees of freedom
Residual deviance: 17009865 on 490739 degrees of freedom
AIC: 17010527
Number of Fisher Scoring iterations: 25
This is the summary of my model. It tells me which variable is important/significant, and the ones that are not. It gives me the AIC, the residual deviance and the null deviance. Withe the number of fisher socering being 25.
Predicted Probabilities
predicted_prob <- predict(model, type = "response")
head(predicted_prob) 1 2 3 4 5 6
2.220446e-16 2.220446e-16 2.220446e-16 2.220446e-16 2.220446e-16 2.220446e-16
predicted_class <- ifelse(predicted_prob > 0.5, 1, 0)This two code chunks is used so I can create and use the confusion Matrix.
Confusion Matrix
confusion_matrix <- table(Predicted = predicted_class,
Actual = crime_clean$property_crime)This is the code for my confusion matrix
confusion_matrix Actual
Predicted 0 1
0 203555 186507
1 49455 51553
And this gives me the TN,FP,FN,TP that I will use later.
TN <-203555
FP <- 49455
FN <- 186507
TP <- 51553
accuracy <- (TP + TN) / (TP + TN + FP + FN)
sensitivity <- TP / (TP + FN)
specificity <- TN / (TN + FP)
precision <- TP / (TP + FP)
cat("Accuracy:", round(accuracy, 3), "\nSensitivity:", round(sensitivity, 3), "\nSpecificity:", round(specificity, 3), "\nPrecision:", round(precision, 3))Accuracy: 0.519
Sensitivity: 0.217
Specificity: 0.805
Precision: 0.51
And by pluging in the numbers and the variables and using it, I can get the accuracy, sensitivity, specificity and precision of the dataset. With the Specificity of the dataset being very good by not so much with the others.
ROC Curve
roc_curve <- roc(crime_clean$property_crime,
predicted_prob)Setting levels: control = 0, case = 1
Setting direction: controls < cases
This is the chunk that makes the roc ## AUC
auc(roc_curve)Area under the curve: 0.5105
This tells me that the auc of the roc is .5105
plot.roc(roc_curve, print.auc = TRUE, legacy.axes = TRUE,
xlab = "False Positive Rate (1 - Specificity)",
ylab = "True Positive Rate (Sensitivity)")Conclusion
This project examined how geographic and crime-related variables influence the chance that a reported incident is classified as a Crime Against Property in Crimes1. Logistic regression was an appropriate statistical method because the response variable was binary. And we found out which variables is significant to the model like victims, the police district names and sectors. And which variables that is not helpful like some of the cities not being useful for the model. And because these variables are significant and have a very small p-value shown on the summary, we can say that these variables does affect the chance of a reported incident is classified as a Crime Against Property. And the only good thing that came out of the confusion matrix being the specificity as it is 0.805 which is high. Everything else is low and is not useful to use. In the future and I want to research more about this dataset, I want to use more variables in the regression model so I can see if the other variables have a affect on Crimes against Property. I had to reduce the amount of variables that I used because I spend hours waiting for the model to run and just for r to crash. So I reduce the variables in the model to what it is currently. So I just have to wait for a little over a hour and the model will run. And that is if r can handle the model using more variables.
References:
https://data.montgomerycountymd.gov/Public-Safety/Crime/icn6-v9z3/about_data