Data606-Final-Proposal

Chris Ayre

4/20/2019

data <- read.csv("/Users/cayre/Google Drive/CUNY SPS Final projs/NYPD_Complaint_Data_Current__Year_To_Date_.csv")

head(data)
##   CMPLNT_NUM ADDR_PCT_CD BORO_NM CMPLNT_FR_DT CMPLNT_FR_TM CMPLNT_TO_DT
## 1  651421035          41   BRONX     11/28/18      0:00:00     11/28/18
## 2  304070477          46   BRONX     12/31/18     23:15:00     12/31/18
## 3  751199176          52   BRONX     12/31/18     23:15:00             
## 4  984349032          43   BRONX     12/31/18     23:08:00             
## 5  140112001          49   BRONX     12/31/18     23:00:00     12/31/18
## 6  574662204          46   BRONX     12/31/18     22:42:00     12/31/18
##   CMPLNT_TO_TM CRM_ATPT_CPTD_CD HADEVELOPT HOUSING_PSA JURISDICTION_CODE
## 1      0:01:00        COMPLETED                     NA                72
## 2     23:25:00        COMPLETED                     NA                 0
## 3                     COMPLETED                     NA                 0
## 4                     COMPLETED  BRONXDALE       66563                 2
## 5     23:04:00        COMPLETED                     NA                 0
## 6     22:58:00        COMPLETED                     NA                 0
##            JURIS_DESC KY_CD  LAW_CAT_CD LOC_OF_OCCUR_DESC
## 1 DEPT OF CORRECTIONS   233 MISDEMEANOR            INSIDE
## 2    N.Y. POLICE DEPT   344 MISDEMEANOR          FRONT OF
## 3    N.Y. POLICE DEPT   348 MISDEMEANOR                  
## 4 N.Y. HOUSING POLICE   351 MISDEMEANOR          FRONT OF
## 5    N.Y. POLICE DEPT   348 MISDEMEANOR                  
## 6    N.Y. POLICE DEPT   121      FELONY          FRONT OF
##                        OFNS_DESC PARKS_NM       PATROL_BORO PD_CD
## 1                     SEX CRIMES          PATROL BORO BRONX   175
## 2   ASSAULT 3 & RELATED OFFENSES          PATROL BORO BRONX   101
## 3       VEHICLE AND TRAFFIC LAWS          PATROL BORO BRONX   916
## 4 CRIMINAL MISCHIEF & RELATED OF          PATROL BORO BRONX   259
## 5       VEHICLE AND TRAFFIC LAWS          PATROL BORO BRONX   922
## 6 CRIMINAL MISCHIEF & RELATED OF          PATROL BORO BRONX   267
##                            PD_DESC              PREM_TYP_DESC   RPT_DT
## 1                 SEXUAL ABUSE 3,2                      OTHER 11/29/18
## 2                        ASSAULT 3     RESIDENCE - APT. HOUSE 12/31/18
## 3   LEAVING SCENE-ACCIDENT-PERSONA                     STREET 12/31/18
## 4 CRIMINAL MISCHIEF,UNCLASSIFIED 4 RESIDENCE - PUBLIC HOUSING 12/31/18
## 5   TRAFFIC,UNCLASSIFIED MISDEMEAN                     STREET 12/31/18
## 6   MISCHIEF, CRIMINAL 3 & 2, OF M                     STREET 12/31/18
##   STATION_NAME SUSP_AGE_GROUP SUSP_RACE SUSP_SEX TRANSIT_DISTRICT
## 1                     UNKNOWN   UNKNOWN        U               NA
## 2                       25-44     BLACK        F               NA
## 3                     UNKNOWN   UNKNOWN        U               NA
## 4                                                              NA
## 5                       45-64     BLACK        M               NA
## 6                       25-44     BLACK        M               NA
##   VIC_AGE_GROUP VIC_RACE VIC_SEX X_COORD_CD Y_COORD_CD Latitude Longitude
## 1         25-44    BLACK       M         NA         NA       NA        NA
## 2         25-44    BLACK       F    1009331     250025 40.85291 -73.90934
## 3         25-44    BLACK       M    1009562     254560 40.86535 -73.90849
## 4         25-44    BLACK       F    1020325     240688 40.82724 -73.86965
## 5       UNKNOWN  UNKNOWN       E    1021171     252475 40.85959 -73.86653
## 6       UNKNOWN  UNKNOWN       E    1011176     248451 40.84858 -73.90268
##                                    Lat_Lon
## 1                                         
## 2  (40.85290843100006, -73.90934005599996)
## 3 (40.865354981000046, -73.90848792599996)
## 4  (40.82724303400005, -73.86964982999997)
## 5  (40.85959137100008, -73.86652804699997)
## 6  (40.84858283500005, -73.90267717899997)

Research Question

For as long as I can remember, The Bronx has had the reputation of being the premiere trope for urban crime & violence within New York City. However, from my experience the crime is not spread evenly across the borough - I believe the reputation of the Bronx was tarnished in the 1980s and never recovered even though the criminal element is no longer as privalent. Consequently, let’s explore how the incidents of crime in the Bronx varied throughout last year. Does the Bronx still deserve its negative reputation?

Cases

What are the cases, and how many are there?

This dataset includes all valid felony, misdemeanor, and violation crimes in the Bronx reported to the New York City Police Department (NYPD) for all of last year (2018). There were a total of 1,018 cases. Each case has relevant data on each reported crime such as the Precint reponsible, Level of offense, date/time, location and 30 others.

Data collection

The data was collected by the New York City Police Department (NYPD) and it consists of all valid felony, misdemeanor, and violation reports they received. The data source was pulled from data.cityofnewyork.us in CSV format.

Type of study

This is an observational study. I will be analyzing data on events that occurred in 2018 [that i did not affect]

Data Source

data.cityofnewyork.us

Response

The response variable is the name of the district the report came from, which is categorical

Explanatory

The explanatory variable is Level of offense of the crime that was reported. This is also a categoricical variable.

Relevant summary statistics

summary(data)
##    CMPLNT_NUM         ADDR_PCT_CD     BORO_NM        CMPLNT_FR_DT  
##  Min.   :100003895   Min.   :25.00   BRONX:101018   8/1/18 :  366  
##  1st Qu.:325773643   1st Qu.:42.00                  6/1/18 :  364  
##  Median :550548354   Median :45.00                  5/31/18:  349  
##  Mean   :550736017   Mean   :45.27                  9/1/18 :  344  
##  3rd Qu.:776743452   3rd Qu.:48.00                  7/29/18:  343  
##  Max.   :999990267   Max.   :88.00                  7/13/18:  339  
##                                                     (Other):98913  
##    CMPLNT_FR_TM    CMPLNT_TO_DT     CMPLNT_TO_TM    CRM_ATPT_CPTD_CD
##  18:00:00: 2101          :24513           :24458   ATTEMPTED: 1495  
##  12:00:00: 2061   5/31/18:  262   12:00:00: 1057   COMPLETED:99523  
##  15:00:00: 2060   7/29/18:  261   8:00:00 : 1039                    
##  20:00:00: 1982   9/4/18 :  258   9:00:00 : 1018                    
##  16:00:00: 1905   6/16/18:  255   15:00:00: 1006                    
##  17:00:00: 1870   11/1/18:  254   16:00:00:  922                    
##  (Other) :89039   (Other):75215   (Other) :71518                    
##         HADEVELOPT     HOUSING_PSA    JURISDICTION_CODE
##              :95292   Min.   :  765   Min.   : 0.000   
##  CASTLE HILL :  429   1st Qu.:  826   1st Qu.: 0.000   
##  THROGGS NECK:  314   Median :  887   Median : 0.000   
##  BRONXDALE   :  289   Mean   :10521   Mean   : 1.169   
##  BUTLER      :  276   3rd Qu.: 5123   3rd Qu.: 0.000   
##  SOUNDVIEW   :  272   Max.   :66871   Max.   :97.000   
##  (Other)     : 4146   NA's   :92217                    
##                JURIS_DESC        KY_CD             LAW_CAT_CD   
##  N.Y. POLICE DEPT   :89080   Min.   :103.0   FELONY     :27194  
##  N.Y. HOUSING POLICE: 8715   1st Qu.:125.0   MISDEMEANOR:57474  
##  N.Y. TRANSIT POLICE: 1907   Median :344.0   VIOLATION  :16350  
##  DEPT OF CORRECTIONS:  658   Mean   :313.4                      
##  OTHER              :  496   3rd Qu.:351.0                      
##  HEALTH & HOSP CORP :   49   Max.   :678.0                      
##  (Other)            :  113                                      
##    LOC_OF_OCCUR_DESC                          OFNS_DESC    
##             :19139   HARRASSMENT 2                 :16245  
##  FRONT OF   :22803   PETIT LARCENY                 :15444  
##  INSIDE     :54230   ASSAULT 3 & RELATED OFFENSES  :14376  
##  OPPOSITE OF: 3250   CRIMINAL MISCHIEF & RELATED OF:10562  
##  REAR OF    : 1596   GRAND LARCENY                 : 6364  
##                      FELONY ASSAULT                : 5808  
##                      (Other)                       :32219  
##                   PARKS_NM                       PATROL_BORO    
##                       :100320   PATROL BORO BKLYN NORTH:     7  
##  RICHMAN (ECHO) PARK  :    50   PATROL BORO BKLYN SOUTH:     1  
##  CROTONA PARK         :    44   PATROL BORO BRONX      :101005  
##  WILLIAMSBRIDGE OVAL  :    39   PATROL BORO MAN NORTH  :     5  
##  BRONX PARK           :    38                                   
##  ST. MARY'S PARK BRONX:    36                                   
##  (Other)              :   491                                   
##      PD_CD                               PD_DESC     
##  Min.   :101   HARASSMENT,SUBD 3,4,5         :12126  
##  1st Qu.:223   ASSAULT 3                     :11249  
##  Median :349   ASSAULT 2,1,UNCLASSIFIED      : 4451  
##  Mean   :403   LARCENY,PETIT FROM STORE-SHOPL: 4420  
##  3rd Qu.:638   AGGRAVATED HARASSMENT 2       : 4260  
##  Max.   :922   HARASSMENT,SUBD 1,CIVILIAN    : 4119  
##                (Other)                       :60393  
##                     PREM_TYP_DESC       RPT_DT     
##  STREET                    :31961   9/4/18 :  356  
##  RESIDENCE - APT. HOUSE    :29647   7/5/18 :  352  
##  RESIDENCE - PUBLIC HOUSING: 8747   5/31/18:  350  
##  RESIDENCE-HOUSE           : 5090   1/24/18:  349  
##  OTHER                     : 3118   9/19/18:  342  
##  CHAIN STORE               : 1972   5/30/18:  340  
##  (Other)                   :20483   (Other):98929  
##                   STATION_NAME   SUSP_AGE_GROUP           SUSP_RACE    
##                         :99106   25-44  :28169   BLACK         :29246  
##  161 ST.-YANKEE STADIUM :  183   UNKNOWN:25146                 :22785  
##  3 AVENUE-149 STREET    :  162          :22785   WHITE HISPANIC:19656  
##  170 STREET             :  127   18-24  :11012   UNKNOWN       :16939  
##  FORDHAM ROAD           :  114   45-64  : 9898   BLACK HISPANIC: 8602  
##  149 ST.-GRAND CONCOURSE:   76   <18    : 3320   WHITE         : 2781  
##  (Other)                : 1250   (Other):  688   (Other)       : 1009  
##  SUSP_SEX  TRANSIT_DISTRICT VIC_AGE_GROUP  
##   :22785   Min.   : 3.00    25-44  :36548  
##  F:16274   1st Qu.:11.00    UNKNOWN:26391  
##  M:49018   Median :11.00    45-64  :19192  
##  U:12941   Mean   :11.31    18-24  :10329  
##            3rd Qu.:12.00    <18    : 5160  
##            Max.   :12.00    65+    : 3391  
##            NA's   :99106    (Other):    7  
##                            VIC_RACE     VIC_SEX     X_COORD_CD     
##  AMERICAN INDIAN/ALASKAN NATIVE:  427   D: 9839   Min.   : 995266  
##  ASIAN / PACIFIC ISLANDER      : 2272   E:14000   1st Qu.:1009107  
##  BLACK                         :27700   F:43661   Median :1013618  
##  BLACK HISPANIC                : 9003   M:33518   Mean   :1015253  
##  UNKNOWN                       :28933             3rd Qu.:1021145  
##  WHITE                         : 5571             Max.   :1044296  
##  WHITE HISPANIC                :27112             NA's   :29       
##    Y_COORD_CD        Latitude       Longitude     
##  Min.   :175595   Min.   :40.65   Min.   :-73.96  
##  1st Qu.:240092   1st Qu.:40.83   1st Qu.:-73.91  
##  Median :245848   Median :40.84   Median :-73.89  
##  Mean   :247168   Mean   :40.85   Mean   :-73.89  
##  3rd Qu.:253649   3rd Qu.:40.86   3rd Qu.:-73.87  
##  Max.   :271820   Max.   :40.91   Max.   :-73.78  
##  NA's   :29       NA's   :29      NA's   :29      
##                                     Lat_Lon     
##  (40.83778161800007, -73.91945797099999):  667  
##  (40.791151867000046, -73.884371919)    :  629  
##  (40.86846737800005, -73.82158284599996):  410  
##  (40.85214118700002, -73.92237572199997):  363  
##  (40.87367103500002, -73.90801364899994):  345  
##  (40.81608887400005, -73.917688689)     :  289  
##  (Other)                                :98315