Introduction to Me!

Hello! I’m a data driven Engineering Manager focused on bringing people, process, and technology together to created highly efficient teams who can deliver valuable outcomes to organizations. Although originally from Long Island, New York, I have spent the majority of my life here in Cincinnati, Ohio.

Academic Background

Professional Background

Currently I am an Engineering Manager in Supply Chain Management at Kroger Technology and Digital and a Master of Science in Information Systems (MSIS) student at the University of Cincinnati. My day-to-day work includes:

  • Work through coursework, reading, discussion posts, and homework before the workday starts
  • Lead and manage a team of engineers
  • Collaborate with business and technology partners to define the technical vision, roadmap, and long-term strategy
  • Implement best practices for software testing and quality assurance
  • Collaborate with project managers and cross-functional teams to prioritize tasks and allocate resources effectively
  • Responsible for systems performance & resolution of production incidents

R Experience

Prior to this course I had never used R or even heard of it. Most of my programming experience has been in SQL and Python which was learned through my work experiences. I am looking forward to learning more about the power of R and how I can use it in my day to day at work.

Other Analytical Software Experience

All of my technical experience has comes from on the job training and incredible mentors who have been willing to teach me. I am still sharpening many of these skills but they include:

  • mySQL
  • PostgreSQL
  • Python
  • Java

Importing Data

Fill in the blanks below to import the blood_transfusion.csv file (provided via Canvas) and answer the following questions.

  1. What are the dimensions of this data (number of rows and columns)?
    There are 748 rows and 5 columns.
# Import the data and the message print out will also tell you what the data types are
df <- readr::read_csv("lab2_data/blood_transfusion.csv")
## Rows: 748 Columns: 5
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): Class
## dbl (4): Recency, Frequency, Monetary, Time
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
# What are the dimensions of this data
dim(df)
## [1] 748   5
  1. What are the data types of each column?
    • Recency = col_double()
    • Frequency = col_double()
    • Monetary = col_double()
    • Time = col_double()
    • Class = col_character()
# Import the data and the message print out will also tell you what the data types are
readr::spec(df)
## cols(
##   Recency = col_double(),
##   Frequency = col_double(),
##   Monetary = col_double(),
##   Time = col_double(),
##   Class = col_character()
## )
  1. Are there any missing values?
    There are no missing values.
# Are there any missing values?
sum(is.na(df))
## [1] 0
  1. Check out the first 10 rows? What are the Class values for the first 10 observations?
    The class values for the first 10 observations are: (1) donated, (2) donated, (3) donated, (4) donated, (5) not donated, (6) not donated, (7) donated, (8) not donated, (9) donated, and (10) donated.
# Check out the first 10 rows
head(df, 10)
## # A tibble: 10 × 5
##    Recency Frequency Monetary  Time Class      
##      <dbl>     <dbl>    <dbl> <dbl> <chr>      
##  1       2        50    12500    98 donated    
##  2       0        13     3250    28 donated    
##  3       1        16     4000    35 donated    
##  4       2        20     5000    45 donated    
##  5       1        24     6000    77 not donated
##  6       4         4     1000     4 not donated
##  7       2         7     1750    14 donated    
##  8       1        12     3000    35 not donated
##  9       2         9     2250    22 donated    
## 10       5        46    11500    98 donated
  1. Check out the last 10 rows? What are the Class values for the last 10 observations?
    All the class values for the last 10 observations are “not donated”.
# Check out the last 10 rows
tail(df, 10)
## # A tibble: 10 × 5
##    Recency Frequency Monetary  Time Class      
##      <dbl>     <dbl>    <dbl> <dbl> <chr>      
##  1      23         1      250    23 not donated
##  2      23         4     1000    52 not donated
##  3      23         1      250    23 not donated
##  4      23         7     1750    88 not donated
##  5      16         3      750    86 not donated
##  6      23         2      500    38 not donated
##  7      21         2      500    52 not donated
##  8      23         3      750    62 not donated
##  9      39         1      250    39 not donated
## 10      72         1      250    72 not donated
  1. Index for the 100th row and just the Monetary column. What is the value?
    The value is 1750.
# Index for the 100th row and just the 'Monetary' column. What is the value?
df[100, 'Monetary']
## # A tibble: 1 × 1
##   Monetary
##      <dbl>
## 1     1750
  1. Index for just the Monetary column. What is the mean of this vector?
    The mean is 1378.676.
# Index for just the 'Monetary' column. What is the mean of this vector?
mean(df[['Monetary']])
## [1] 1378.676
  1. Subset this data frame for all observations where Monetary is greater than the mean value. How many rows are in the resulting data frame?
    There are 267 rows in the resulting data frame.
# Subset this data frame for all observations where 'Monetary' is greater than the mean
# value. How many rows are in the resulting data frame?
above_avg <- df[['Monetary']] > mean(df[['Monetary']])
df[above_avg, 'Monetary']
## # A tibble: 267 × 1
##    Monetary
##       <dbl>
##  1    12500
##  2     3250
##  3     4000
##  4     5000
##  5     6000
##  6     1750
##  7     3000
##  8     2250
##  9    11500
## 10     5750
## # ℹ 257 more rows

Go to this University of Dayton webpage http://academic.udayton.edu/kissock/http/Weather/citylistUS.htm, scroll down to Ohio and import the Cincinnati (OHCINCIN.txt) file. Fill in the blanks below to import the data directly from online and answer the questions that follow.

  1. What are the dimensions of this data (number of rows and columns)?
    There are 9265 rows and 4 columns.
# Import the data
df <- readr::read_table("https://academic.udayton.edu/kissock/http/Weather/gsod95-current/OHCINCIN.txt", 
  col_names = c('Month', 'Day', 'Year', 'Avg_temp'))
## 
## ── Column specification ────────────────────────────────────────────────────────
## cols(
##   Month = col_double(),
##   Day = col_double(),
##   Year = col_double(),
##   Avg_temp = col_double()
## )
## Warning: 3 parsing failures.
##  row col  expected    actual                                                                            file
## 4623  -- 4 columns 5 columns 'https://academic.udayton.edu/kissock/http/Weather/gsod95-current/OHCINCIN.txt'
## 5016  -- 4 columns 5 columns 'https://academic.udayton.edu/kissock/http/Weather/gsod95-current/OHCINCIN.txt'
## 5213  -- 4 columns 5 columns 'https://academic.udayton.edu/kissock/http/Weather/gsod95-current/OHCINCIN.txt'
# Dimensions of imported data
dim(df)
## [1] 9265    4
  1. What do you think these columns represent?
    These columns represent the daily average temperature between 1995 - 2020 in Ohio.
range(df[['Year']])
## [1] 1995 2020
  1. Are there any missing values in this data?
    There are no missing values in this data.
# Any missing data
sum(is.na(df))
## [1] 0
  1. Index for the 365th row. What is the date of this observation and what was the average temperature?
    The date of this observation is December 31, 1995 and the average temperature was 39.3.
# Subset for the 365th observation
df[365, ]
## # A tibble: 1 × 4
##   Month   Day  Year Avg_temp
##   <dbl> <dbl> <dbl>    <dbl>
## 1    12    31  1995     39.3
  1. Subset for all observations that happened during January of 2000. What was the median average temp for this month?
    The median average temperature during January of 2000 was 27.1.
# Subset for all observations that happened during January of 2000
jan_2000 <- df[df[['Month']] == 1 & df[['Year']] == 2000, ]

# Compute the median avg temp of this month
median(jan_2000[['Avg_temp']])
## [1] 27.1
  1. Which date was the highest average temp recorded (hint: which.max)?
    July 7, 2012 was the highest average temperature recorded at 89.2.
# Which date was the highest average temp recorded?
df[which.max(df[['Avg_temp']]),]
## # A tibble: 1 × 4
##   Month   Day  Year Avg_temp
##   <dbl> <dbl> <dbl>    <dbl>
## 1     7     7  2012     89.2
  1. Which date was the coldest average temp recorded? Does this temp make sense? Are there more than just one date that has this temperature value recorded? If so, how many?
    December 24, 1998 was the coldest average temperature recorded at -99. This temperature does not make sense as -99 is incredibly cold for the Cincinnati climate. There are 14 dates that have this temperature value recorded.
# Which date was the coldest average temp recorded?
df[which.min(df[['Avg_temp']]), ]
## # A tibble: 1 × 4
##   Month   Day  Year Avg_temp
##   <dbl> <dbl> <dbl>    <dbl>
## 1    12    24  1998      -99
# How many of these -99s are there?
sum(df[['Avg_temp']] == -99)
## [1] 14
  1. Compute the mean of the average temp column. Now re-code all -99s to NA and recompute the mean.
    The average temperature was 54.39876 before re-coding. Once the -99s were re-coded to NA, the new mean became 54.6309.
# Mean the avg temp column
mean(df[['Avg_temp']])
## [1] 54.39876
# Re-code -99s to NA
bad_values <- df[['Avg_temp']] == -99
df[bad_values, 'Avg_temp'] <- NA

# Recompute the avg temp mean
mean(df[['Avg_temp']], na.rm = TRUE)
## [1] 54.6309

Fill in the blanks below to import the PDI__Police_Data_Initiative__Crime_Incidents.csv data (provided via Canvas) and answer the questions that follow. Data is taken from the City of Cincinnati Open Data Portal website , which you may need to read to place context in your answers.

  1. What are the dimensions of this data (number of rows and columns)?
    There are 15155 rows and 40 columns in this data.
# Import the data
df <- readr::read_csv("lab2_data/PDI__Police_Data_Initiative__Crime_Incidents.csv")
## Rows: 15155 Columns: 40
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (34): INSTANCEID, INCIDENT_NO, DATE_REPORTED, DATE_FROM, DATE_TO, CLSD, ...
## dbl  (6): UCR, LONGITUDE_X, LATITUDE_X, TOTALNUMBERVICTIMS, TOTALSUSPECTS, ZIP
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
# Dimensions of this data
dim(df)
## [1] 15155    40
  1. What do you think these columns represent?
    These columns represent various criteria for a given incident (date reported, location, etc.) in the city of Cincinnati.

  2. Are there any missing values in this data? If so, how many missing values are in each column? Which column has the most missing values?
    Yes, there are a total of 95592 missing data points. The Opening column has the most with 14508 missing values.

# Are there any missing data
sum(is.na(df))
## [1] 95592
# If so, how many missing values are in each column?
colSums(is.na(df))
##                     INSTANCEID                    INCIDENT_NO 
##                              0                              0 
##                  DATE_REPORTED                      DATE_FROM 
##                              0                              2 
##                        DATE_TO                           CLSD 
##                              9                            545 
##                            UCR                            DST 
##                             10                              0 
##                           BEAT                        OFFENSE 
##                             28                             10 
##                       LOCATION                     THEFT_CODE 
##                              2                          10167 
##                          FLOOR                           SIDE 
##                          14127                          14120 
##                        OPENING                      HATE_BIAS 
##                          14508                              0 
##                      DAYOFWEEK                       RPT_AREA 
##                            423                            239 
##               CPD_NEIGHBORHOOD                        WEAPONS 
##                            249                              5 
##              DATE_OF_CLEARANCE                      HOUR_FROM 
##                           2613                              2 
##                        HOUR_TO                      ADDRESS_X 
##                              9                            148 
##                    LONGITUDE_X                     LATITUDE_X 
##                           1714                           1714 
##                     VICTIM_AGE                    VICTIM_RACE 
##                              0                           2192 
##               VICTIM_ETHNICITY                  VICTIM_GENDER 
##                           2192                           2192 
##                    SUSPECT_AGE                   SUSPECT_RACE 
##                              0                           7082 
##              SUSPECT_ETHNICITY                 SUSPECT_GENDER 
##                           7082                           7082 
##             TOTALNUMBERVICTIMS                  TOTALSUSPECTS 
##                             33                           7082 
##                      UCR_GROUP                            ZIP 
##                             10                              1 
## COMMUNITY_COUNCIL_NEIGHBORHOOD               SNA_NEIGHBORHOOD 
##                              0                              0
# Which column has the most missing values?
max(colSums(is.na(df)))
## [1] 14508
  1. Using the DATE_REPORTED column, what is the range of dates included in this data?
    The range of the dates are 01/01/2022 01:08:00 AM - 06/26/2022 12:50:00 AM
# Using the 'DATE_REPORTED' column, what is the 'range' of dates included in this data?
range(df[['DATE_REPORTED']])
## [1] "01/01/2022 01:08:00 AM" "06/26/2022 12:50:00 AM"
  1. Using table(), what is the most common age range for known SUSPECT_AGEs?
    The most common age range for known ‘SUSPECT_AGE’ is 18-25.
# Using `table()`, what is the most common age range for known `SUSPECT_AGE`s?
table(df[['SUSPECT_AGE']])
## 
##    18-25    26-30    31-40    41-50    51-60    61-70  OVER 70 UNDER 18 
##     1778     1126     1525      659      298      121       16      629 
##  UNKNOWN 
##     9003
  1. Use table() to get the number of incidents per zip code. Sort this table for those zip codes with the most activity to the least activity. Which zip code has the most incidents? Do you see any peculiar data quality issues with any of these zip code values?
    Zip code 45202 had the most incidents. One data quality issue with some of these zip codes is that they are not the standard 5-digit zip code length. It looks like there were potential “0”s stripped from the data.
# Use 'table()'to get the number of incidents per zip code. Sort this table
# for those Zip codes with the most activity to the least activity.
sort(table(df['ZIP']), decreasing = TRUE)
## ZIP
## 45202 45205 45211 45238 45229 45219 45225 45214 45237 45223 45206 45220 45232 
##  2049  1110  1094   956   913   863   811   774   699   653   616   477   477 
## 45224 45209 45208 45204 45216 45227 45207 45203 45230 45213 45239 45226 45217 
##   429   380   359   348   302   286   245   226   214   190   169   112   100 
## 45221 45233 45212 45215 45231 45228 42502 45236 45244 45248  4523  5239 
##    90    77    61    47     7     5     3     3     3     3     2     1
  1. Using the DAYOFWEEK column, which day do most incidents occur on? What is the proportion of incidents that fall on this day?
    Most incidents have occurred on a Saturday with 2272 incidents. The proportion of incidents that fall on Saturday is .1542221.
# Using the 'DAYOFWEEK' column, which day do most incidents occur on? 
table(df[['DAYOFWEEK']])
## 
##    FRIDAY    MONDAY  SATURDAY    SUNDAY  THURSDAY   TUESDAY WEDNESDAY 
##      2018      2119      2272      2134      2008      2111      2070
# What is the proportion of incidents that fall on this day?
table(df[['DAYOFWEEK']]) / sum(table(df[['DAYOFWEEK']]))
## 
##    FRIDAY    MONDAY  SATURDAY    SUNDAY  THURSDAY   TUESDAY WEDNESDAY 
## 0.1369807 0.1438365 0.1542221 0.1448547 0.1363019 0.1432935 0.1405105
  1. Looking at the information this data set provides, what are some insights you’d be interested in assessing? Analyze three different columns that could start to provide you with these insights. Are there missing values in these columns? What are some summary statistics you can compute for these columns? Are there any outliers or aberrant values in these columns? How do you know? Would you remove or re-code them?
    Looking at the information provided I would be interested in understanding what the different types, the number of crimes committed by women vs. men, the weapons used and combination of the two to see what genders are committing what crimes. Each of the three columns below are missing data points. Using the table function and division we can pull the proportion of each category against the whole. This is is helpful in identifying outliers and potential trends in the data. Based on the output, the Business type for SUSPECT_GENDER may be a potential outlier with out accounting for .00049 of the data set. The Explosives and Poison also appear to be potential outliers for the WEAPONS data as they are a significantly smaller proportion of the data. Based on the outliers identified, I would look to exclude the WEAPONS data while I would re-code the Business data points as they appear incorrect for the SUSPECT_GENDER data instead an actual outlier.
# What are the different types of offenses that occur and how many
sort(table(df[['OFFENSE']]), decreasing = TRUE)
## 
##                                                    THEFT 
##                                                     4988 
##                            CRIMINAL DAMAGING/ENDANGERING 
##                                                     2248 
##                                                  ASSAULT 
##                                                     1668 
##                                        DOMESTIC VIOLENCE 
##                                                      916 
##                                        FELONIOUS ASSAULT 
##                                                      639 
##                                      AGGRAVATED MENACING 
##                                                      591 
##                                                 BURGLARY 
##                                                      514 
##                                    BREAKING AND ENTERING 
##                                                      451 
##                                       AGGRAVATED ROBBERY 
##                                                      399 
##                                                 MENACING 
##                                                      356 
##                                     TELEPHONE HARASSMENT 
##                                                      297 
##                                                  FORGERY 
##                                                      266 
##                                                  ROBBERY 
##                                                      234 
##                           TAKING THE IDENTITY OF ANOTHER 
##                                                      233 
##                                      AGGRAVATED BURGLARY 
##                                                      162 
##                                                     RAPE 
##                                                      148 
##               VIOLATE PROTECTION ORDER/CONSENT AGREEMENT 
##                                                      148 
## IMPROPERLY DISCHARGING FIREARM AT/INTO HABITATION/SCHOOL 
##                                                      142 
##                        UNAUTHORIZED USE OF MOTOR VEHICLE 
##                                                      121 
##                                     ENDANGERING CHILDREN 
##                                                       74 
##                                                   MURDER 
##                                                       43 
##                                    MISUSE OF CREDIT CARD 
##                                                       39 
##                                                VANDALISM 
##                                                       38 
##                                INTERFERENCE WITH CUSTODY 
##                                                       35 
##                                        CRIMINAL MISCHIEF 
##                                                       28 
##                FAIL COMPLY ORDER/SIGNAL OF PO-ELUDE/FLEE 
##                                                       28 
##                                     MENACING BY STALKING 
##                                                       28 
##                                      VEHICULAR VANDALISM 
##                                                       26 
##                                           INDUCING PANIC 
##                                                       25 
##                                       AGGRAVATED ASSAULT 
##                                                       22 
##                                  GROSS SEXUAL IMPOSITION 
##                                                       22 
##                                                ABDUCTION 
##                                                       21 
##                                        SEXUAL IMPOSITION 
##                                                       21 
##                                         PUBLIC INDECENCY 
##                                                       18 
##                                      MAKING FALSE ALARMS 
##                                                       17 
##                                       PASSING BAD CHECKS 
##                                                       15 
##                                 TELECOMMUNICATIONS FRAUD 
##                                                       14 
##                                       UNLAWFUL RESTRAINT 
##                                                       14 
##                                                EXTORTION 
##                                                       10 
##                                        AGGRAVATED MURDER 
##                                                        9 
##                                             SAFECRACKING 
##                                                        7 
##                                DISRUPTING PUBLIC SERVICE 
##                                                        6 
##                             AGGRAVATED VEHICULAR ASSAULT 
##                                                        5 
##                                               KIDNAPPING 
##                                                        5 
##                                           SEXUAL BATTERY 
##                                                        5 
##                             UNAUTHORIZED USE OF PROPERTY 
##                                                        5 
##                                                VOYEURISM 
##                                                        5 
##                                      AGGRAVATED TRESPASS 
##                                                        4 
##                                      ETHNIC INTIMIDATION 
##                                                        4 
##                                             INTIMIDATION 
##                                                        4 
##                             TAMPERING WITH COIN MACHINES 
##                                                        4 
##                     UNLAWFUL SEXUAL CONDUCT WITH A MINOR 
##                                                        4 
##                        AGG VEH HOM/VEH HOM/VEH MNSLGHTER 
##                                                        3 
##                                      CRIMINAL SIMULATION 
##                                                        3 
##                                CRIMINAL CHILD ENTICEMENT 
##                                                        2 
##            IMPERSONATING PEACE OFFICER/PRIVATE POLICEMAN 
##                                                        2 
##                                   PATIENT ABUSE; NEGLECT 
##                                                        2 
##                                                    ARSON 
##                                                        1 
##                                                  BRIBERY 
##                                                        1 
##                                             EMBEZZLEMENT 
##                                                        1 
##                                        NEGLIGENT ASSAULT 
##                                                        1 
##                                        RECKLESS HOMICIDE 
##                                                        1 
##                                                  RUNAWAY 
##                                                        1 
##                                               WIRE FRAUD 
##                                                        1
# Number of crimes committed by women vs. men
table(df[['SUSPECT_GENDER']])
## 
##               FEMALE                 MALE NON-PERSON (BUSINESS 
##                 2052                 5397                    4 
##              UNKNOWN 
##                  620
# Weapon used in crime
table(df[['WEAPONS']])
## 
##                              11 - FIREARM (TYPE NOT STATED) 
##                                                         531 
##                                                12 - HANDGUN 
##                                                         934 
##                                     12A - AUTOMATIC HANDGUN 
##                                                          16 
##                                                  13 - RIFLE 
##                                                          42 
##                                                14 - SHOTGUN 
##                                                          13 
##                                          15 - OTHER FIREARM 
##                                                           3 
##                                      16 - IMITATION FIREARM 
##                                                           4 
##                                      17 - SIMULATED FIREARM 
##                                                           6 
##                                     18 - BB AND PELLET GUNS 
##                                                          32 
##           20 - KNIFE/CUTTING INSTRUMENT (ICEPICK, AX, ETC.) 
##                                                         247 
##                      30 - BLUNT OBJECT (CLUB, HAMMER, ETC.) 
##                                                         333 
##                    35 - MOTOR VEHICLE (WHEN USED AS WEAPON) 
##                                                         122 
##            40 - PERSONAL WEAPONS (HANDS, FEET, TEETH, ETC.) 
##                                                        2827 
##                                                 50 - POISON 
##                                                           1 
##                                             60 - EXPLOSIVES 
##                                                           1 
##                                 65 - FIRE/INCENDIARY DEVICE 
##                                                           7 
##                         70 - DRUGS/NARCOTICS/SLEEPING PILLS 
##                                                           2 
##                                           80 - OTHER WEAPON 
##                                                         348 
## 85 - ASPHYXIATION (BY DROWNING, STRANGULATION, SUFFOCATION) 
##                                                           2 
##                                                   99 - NONE 
##                                                        8106 
##                                                 U - UNKNOWN 
##                                                        1573
# What gender is committing what crimes
table(df[['SUSPECT_GENDER']], df[['OFFENSE']])
##                       
##                        ABDUCTION AGG VEH HOM/VEH HOM/VEH MNSLGHTER
##   FEMALE                       0                                 0
##   MALE                        12                                 2
##   NON-PERSON (BUSINESS         0                                 0
##   UNKNOWN                      0                                 0
##                       
##                        AGGRAVATED ASSAULT AGGRAVATED BURGLARY
##   FEMALE                               10                  20
##   MALE                                  7                 127
##   NON-PERSON (BUSINESS                  0                   0
##   UNKNOWN                               0                   2
##                       
##                        AGGRAVATED MENACING AGGRAVATED MURDER AGGRAVATED ROBBERY
##   FEMALE                               107                 0                 20
##   MALE                                 298                 1                330
##   NON-PERSON (BUSINESS                   0                 0                  1
##   UNKNOWN                                7                 8                 11
##                       
##                        AGGRAVATED TRESPASS AGGRAVATED VEHICULAR ASSAULT ARSON
##   FEMALE                                 0                            1     0
##   MALE                                   1                            0     0
##   NON-PERSON (BUSINESS                   0                            0     0
##   UNKNOWN                                0                            0     0
##                       
##                        ASSAULT BREAKING AND ENTERING BRIBERY BURGLARY
##   FEMALE                   423                    19       1       49
##   MALE                     764                   128       0      169
##   NON-PERSON (BUSINESS       0                     1       0        0
##   UNKNOWN                   14                    21       0       19
##                       
##                        CRIMINAL CHILD ENTICEMENT CRIMINAL DAMAGING/ENDANGERING
##   FEMALE                                       0                           243
##   MALE                                         2                           676
##   NON-PERSON (BUSINESS                         0                             0
##   UNKNOWN                                      0                           137
##                       
##                        CRIMINAL MISCHIEF CRIMINAL SIMULATION
##   FEMALE                               3                   0
##   MALE                                 7                   2
##   NON-PERSON (BUSINESS                 0                   0
##   UNKNOWN                              4                   0
##                       
##                        DISRUPTING PUBLIC SERVICE DOMESTIC VIOLENCE EMBEZZLEMENT
##   FEMALE                                       0                90            0
##   MALE                                         2               379            1
##   NON-PERSON (BUSINESS                         0                 0            0
##   UNKNOWN                                      0                 1            0
##                       
##                        ENDANGERING CHILDREN ETHNIC INTIMIDATION EXTORTION
##   FEMALE                                 32                   0         2
##   MALE                                   11                   3         1
##   NON-PERSON (BUSINESS                    0                   0         0
##   UNKNOWN                                 0                   0         3
##                       
##                        FAIL COMPLY ORDER/SIGNAL OF PO-ELUDE/FLEE
##   FEMALE                                                       2
##   MALE                                                        12
##   NON-PERSON (BUSINESS                                         0
##   UNKNOWN                                                      2
##                       
##                        FELONIOUS ASSAULT FORGERY GROSS SEXUAL IMPOSITION
##   FEMALE                             113      13                       2
##   MALE                               323      56                      19
##   NON-PERSON (BUSINESS                 0       0                       0
##   UNKNOWN                             59      32                       0
##                       
##                        IMPERSONATING PEACE OFFICER/PRIVATE POLICEMAN
##   FEMALE                                                           0
##   MALE                                                             0
##   NON-PERSON (BUSINESS                                             0
##   UNKNOWN                                                          0
##                       
##                        IMPROPERLY DISCHARGING FIREARM AT/INTO HABITATION/SCHOOL
##   FEMALE                                                                      4
##   MALE                                                                       42
##   NON-PERSON (BUSINESS                                                        0
##   UNKNOWN                                                                    64
##                       
##                        INDUCING PANIC INTERFERENCE WITH CUSTODY INTIMIDATION
##   FEMALE                            1                        10            1
##   MALE                              2                         9            1
##   NON-PERSON (BUSINESS              0                         0            0
##   UNKNOWN                           0                         0            0
##                       
##                        KIDNAPPING MAKING FALSE ALARMS MENACING
##   FEMALE                        2                   3      120
##   MALE                          1                   4      141
##   NON-PERSON (BUSINESS          0                   0        0
##   UNKNOWN                       0                   1        0
##                       
##                        MENACING BY STALKING MISUSE OF CREDIT CARD MURDER
##   FEMALE                                  3                     9      0
##   MALE                                   18                    11     16
##   NON-PERSON (BUSINESS                    0                     0      0
##   UNKNOWN                                 0                     1      8
##                       
##                        NEGLIGENT ASSAULT PASSING BAD CHECKS
##   FEMALE                               0                  4
##   MALE                                 0                  6
##   NON-PERSON (BUSINESS                 0                  0
##   UNKNOWN                              0                  0
##                       
##                        PATIENT ABUSE; NEGLECT PUBLIC INDECENCY RAPE
##   FEMALE                                    1                0   12
##   MALE                                      0               11  107
##   NON-PERSON (BUSINESS                      0                0    0
##   UNKNOWN                                   0                0    2
##                       
##                        RECKLESS HOMICIDE ROBBERY RUNAWAY SAFECRACKING
##   FEMALE                               0      41       0            0
##   MALE                                 0     166       0            2
##   NON-PERSON (BUSINESS                 0       0       0            0
##   UNKNOWN                              0       4       0            0
##                       
##                        SEXUAL BATTERY SEXUAL IMPOSITION
##   FEMALE                            0                 0
##   MALE                              5                19
##   NON-PERSON (BUSINESS              0                 0
##   UNKNOWN                           0                 0
##                       
##                        TAKING THE IDENTITY OF ANOTHER
##   FEMALE                                           24
##   MALE                                             25
##   NON-PERSON (BUSINESS                              0
##   UNKNOWN                                           9
##                       
##                        TAMPERING WITH COIN MACHINES TELECOMMUNICATIONS FRAUD
##   FEMALE                                          0                        0
##   MALE                                            0                        4
##   NON-PERSON (BUSINESS                            0                        0
##   UNKNOWN                                         0                        0
##                       
##                        TELEPHONE HARASSMENT THEFT
##   FEMALE                                105   498
##   MALE                                  137  1138
##   NON-PERSON (BUSINESS                    0     2
##   UNKNOWN                                 6   196
##                       
##                        UNAUTHORIZED USE OF MOTOR VEHICLE
##   FEMALE                                              37
##   MALE                                                77
##   NON-PERSON (BUSINESS                                 0
##   UNKNOWN                                              0
##                       
##                        UNAUTHORIZED USE OF PROPERTY UNLAWFUL RESTRAINT
##   FEMALE                                          2                  1
##   MALE                                            2                  7
##   NON-PERSON (BUSINESS                            0                  0
##   UNKNOWN                                         0                  0
##                       
##                        UNLAWFUL SEXUAL CONDUCT WITH A MINOR VANDALISM
##   FEMALE                                                  0         4
##   MALE                                                    4        14
##   NON-PERSON (BUSINESS                                    0         0
##   UNKNOWN                                                 0         2
##                       
##                        VEHICULAR VANDALISM
##   FEMALE                                 0
##   MALE                                   4
##   NON-PERSON (BUSINESS                   0
##   UNKNOWN                                6
##                       
##                        VIOLATE PROTECTION ORDER/CONSENT AGREEMENT VOYEURISM
##   FEMALE                                                       16         0
##   MALE                                                         80         5
##   NON-PERSON (BUSINESS                                          0         0
##   UNKNOWN                                                       0         0
##                       
##                        WIRE FRAUD
##   FEMALE                        0
##   MALE                          1
##   NON-PERSON (BUSINESS          0
##   UNKNOWN                       0
# Missing data points
colSums(is.na(df['WEAPONS']))
## WEAPONS 
##       5
colSums(is.na(df['OFFENSE']))
## OFFENSE 
##      10
colSums(is.na(df['SUSPECT_GENDER']))
## SUSPECT_GENDER 
##           7082
# Summary statistics
table(df[['SUSPECT_GENDER']]) / sum(table(df[['SUSPECT_GENDER']]))
## 
##               FEMALE                 MALE NON-PERSON (BUSINESS 
##         0.2541806020         0.6685247120         0.0004954788 
##              UNKNOWN 
##         0.0767992072
table(df[['WEAPONS']]) / sum(table(df[['WEAPONS']]))
## 
##                              11 - FIREARM (TYPE NOT STATED) 
##                                                0.0350495050 
##                                                12 - HANDGUN 
##                                                0.0616501650 
##                                     12A - AUTOMATIC HANDGUN 
##                                                0.0010561056 
##                                                  13 - RIFLE 
##                                                0.0027722772 
##                                                14 - SHOTGUN 
##                                                0.0008580858 
##                                          15 - OTHER FIREARM 
##                                                0.0001980198 
##                                      16 - IMITATION FIREARM 
##                                                0.0002640264 
##                                      17 - SIMULATED FIREARM 
##                                                0.0003960396 
##                                     18 - BB AND PELLET GUNS 
##                                                0.0021122112 
##           20 - KNIFE/CUTTING INSTRUMENT (ICEPICK, AX, ETC.) 
##                                                0.0163036304 
##                      30 - BLUNT OBJECT (CLUB, HAMMER, ETC.) 
##                                                0.0219801980 
##                    35 - MOTOR VEHICLE (WHEN USED AS WEAPON) 
##                                                0.0080528053 
##            40 - PERSONAL WEAPONS (HANDS, FEET, TEETH, ETC.) 
##                                                0.1866006601 
##                                                 50 - POISON 
##                                                0.0000660066 
##                                             60 - EXPLOSIVES 
##                                                0.0000660066 
##                                 65 - FIRE/INCENDIARY DEVICE 
##                                                0.0004620462 
##                         70 - DRUGS/NARCOTICS/SLEEPING PILLS 
##                                                0.0001320132 
##                                           80 - OTHER WEAPON 
##                                                0.0229702970 
## 85 - ASPHYXIATION (BY DROWNING, STRANGULATION, SUFFOCATION) 
##                                                0.0001320132 
##                                                   99 - NONE 
##                                                0.5350495050 
##                                                 U - UNKNOWN 
##                                                0.1038283828
table(df[['OFFENSE']]) / sum(table(df[['OFFENSE']]))
## 
##                                                ABDUCTION 
##                                             1.386596e-03 
##                        AGG VEH HOM/VEH HOM/VEH MNSLGHTER 
##                                             1.980852e-04 
##                                       AGGRAVATED ASSAULT 
##                                             1.452625e-03 
##                                      AGGRAVATED BURGLARY 
##                                             1.069660e-02 
##                                      AGGRAVATED MENACING 
##                                             3.902278e-02 
##                                        AGGRAVATED MURDER 
##                                             5.942555e-04 
##                                       AGGRAVATED ROBBERY 
##                                             2.634533e-02 
##                                      AGGRAVATED TRESPASS 
##                                             2.641136e-04 
##                             AGGRAVATED VEHICULAR ASSAULT 
##                                             3.301420e-04 
##                                                    ARSON 
##                                             6.602839e-05 
##                                                  ASSAULT 
##                                             1.101354e-01 
##                                    BREAKING AND ENTERING 
##                                             2.977880e-02 
##                                                  BRIBERY 
##                                             6.602839e-05 
##                                                 BURGLARY 
##                                             3.393859e-02 
##                                CRIMINAL CHILD ENTICEMENT 
##                                             1.320568e-04 
##                            CRIMINAL DAMAGING/ENDANGERING 
##                                             1.484318e-01 
##                                        CRIMINAL MISCHIEF 
##                                             1.848795e-03 
##                                      CRIMINAL SIMULATION 
##                                             1.980852e-04 
##                                DISRUPTING PUBLIC SERVICE 
##                                             3.961704e-04 
##                                        DOMESTIC VIOLENCE 
##                                             6.048201e-02 
##                                             EMBEZZLEMENT 
##                                             6.602839e-05 
##                                     ENDANGERING CHILDREN 
##                                             4.886101e-03 
##                                      ETHNIC INTIMIDATION 
##                                             2.641136e-04 
##                                                EXTORTION 
##                                             6.602839e-04 
##                FAIL COMPLY ORDER/SIGNAL OF PO-ELUDE/FLEE 
##                                             1.848795e-03 
##                                        FELONIOUS ASSAULT 
##                                             4.219214e-02 
##                                                  FORGERY 
##                                             1.756355e-02 
##                                  GROSS SEXUAL IMPOSITION 
##                                             1.452625e-03 
##            IMPERSONATING PEACE OFFICER/PRIVATE POLICEMAN 
##                                             1.320568e-04 
## IMPROPERLY DISCHARGING FIREARM AT/INTO HABITATION/SCHOOL 
##                                             9.376032e-03 
##                                           INDUCING PANIC 
##                                             1.650710e-03 
##                                INTERFERENCE WITH CUSTODY 
##                                             2.310994e-03 
##                                             INTIMIDATION 
##                                             2.641136e-04 
##                                               KIDNAPPING 
##                                             3.301420e-04 
##                                      MAKING FALSE ALARMS 
##                                             1.122483e-03 
##                                                 MENACING 
##                                             2.350611e-02 
##                                     MENACING BY STALKING 
##                                             1.848795e-03 
##                                    MISUSE OF CREDIT CARD 
##                                             2.575107e-03 
##                                                   MURDER 
##                                             2.839221e-03 
##                                        NEGLIGENT ASSAULT 
##                                             6.602839e-05 
##                                       PASSING BAD CHECKS 
##                                             9.904259e-04 
##                                   PATIENT ABUSE; NEGLECT 
##                                             1.320568e-04 
##                                         PUBLIC INDECENCY 
##                                             1.188511e-03 
##                                                     RAPE 
##                                             9.772202e-03 
##                                        RECKLESS HOMICIDE 
##                                             6.602839e-05 
##                                                  ROBBERY 
##                                             1.545064e-02 
##                                                  RUNAWAY 
##                                             6.602839e-05 
##                                             SAFECRACKING 
##                                             4.621987e-04 
##                                           SEXUAL BATTERY 
##                                             3.301420e-04 
##                                        SEXUAL IMPOSITION 
##                                             1.386596e-03 
##                           TAKING THE IDENTITY OF ANOTHER 
##                                             1.538462e-02 
##                             TAMPERING WITH COIN MACHINES 
##                                             2.641136e-04 
##                                 TELECOMMUNICATIONS FRAUD 
##                                             9.243975e-04 
##                                     TELEPHONE HARASSMENT 
##                                             1.961043e-02 
##                                                    THEFT 
##                                             3.293496e-01 
##                        UNAUTHORIZED USE OF MOTOR VEHICLE 
##                                             7.989435e-03 
##                             UNAUTHORIZED USE OF PROPERTY 
##                                             3.301420e-04 
##                                       UNLAWFUL RESTRAINT 
##                                             9.243975e-04 
##                     UNLAWFUL SEXUAL CONDUCT WITH A MINOR 
##                                             2.641136e-04 
##                                                VANDALISM 
##                                             2.509079e-03 
##                                      VEHICULAR VANDALISM 
##                                             1.716738e-03 
##               VIOLATE PROTECTION ORDER/CONSENT AGREEMENT 
##                                             9.772202e-03 
##                                                VOYEURISM 
##                                             3.301420e-04 
##                                               WIRE FRAUD 
##                                             6.602839e-05