The Data
For this project, I have selected the wide data set by Brian Kreis in Forum: Discussion 6/7: Untidy Data. This data comes from the FBI Uniform Crime Reports. Brian posted the csv file which has been downloaded into my working directory. The csv file is also posted on GitHub.
Analysis Question
As per Brian, this data set “could be used to look at crime levels for different types of crime in various sized cities. For example, property versus violent crimes in different city sizes per 100,000 in population.” I cannot transform the Population Groups into 100K intervals. As a result, I will focus on comparing Property vs. Violent crimes in different Population Groups. This is a similar analysis.
library(stringr)
library(tidyr)
library(dplyr)
##
## Attaching package: 'dplyr'
##
## The following objects are masked from 'package:stats':
##
## filter, lag
##
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
In this section, I import the data from my working directory and control several parameters of the read.csv function to have greater control on what is imported. I also take a peak at the data and determine the structure.
mydata <- read.csv("crimestatistics.csv", header = TRUE, nrows = 42, skip = 3, stringsAsFactors = FALSE)
head(mydata)
## Population.group X Violent..crime
## 1 TOTAL ALL AGENCIES: 2012 1,145,272
## 2 2013 1,095,149
## 3 Percent change -4.4
## 4 TOTAL CITIES 2012 919,218
## 5 2013 877,594
## 6 Percent change -4.5
## Murder.and..nonnegligent..manslaughter Forcible..rape1 Robbery
## 1 14,349 65,733 345,758
## 2 13,716 62,034 335,428
## 3 -4.4 -5.6 -3.0
## 4 11,198 50,003 303,475
## 5 10,511 47,606 294,292
## 6 -6.1 -4.8 -3.0
## Aggravated..assault Property..crime Burglary Larceny..theft
## 1 719,432 8,507,866 1,992,895 5,816,991
## 2 683,971 8,160,228 1,820,544 5,665,392
## 3 -4.9 -4.1 -8.6 -2.6
## 4 554,542 6,671,809 1,460,169 4,655,398
## 5 525,185 6,434,879 1,335,527 4,557,867
## 6 -5.3 -3.6 -8.5 -2.1
## Motor..vehicle..theft Arson Number..of..agencies
## 1 697,980 51,126
## 2 674,292 44,245 15,232
## 3 -3.4 -13.5
## 4 556,242 38,974
## 5 541,485 33,432 11,031
## 6 -2.7 -14.2
## X2013..estimated..population X.1 X.2 X.3
## 1 NA NA NA
## 2 299,269,511 NA NA NA
## 3 NA NA NA
## 4 NA NA NA
## 5 202,966,923 NA NA NA
## 6 NA NA NA
str(mydata)
## 'data.frame': 42 obs. of 17 variables:
## $ Population.group : chr "TOTAL ALL AGENCIES:" "" "" "TOTAL CITIES" ...
## $ X : chr "2012" "2013" "Percent change" "2012" ...
## $ Violent..crime : chr "1,145,272" "1,095,149" "-4.4 " "919,218" ...
## $ Murder.and..nonnegligent..manslaughter: chr "14,349" "13,716" "-4.4 " "11,198" ...
## $ Forcible..rape1 : chr "65,733" "62,034" "-5.6 " "50,003" ...
## $ Robbery : chr "345,758" "335,428" "-3.0 " "303,475" ...
## $ Aggravated..assault : chr "719,432" "683,971" "-4.9 " "554,542" ...
## $ Property..crime : chr "8,507,866" "8,160,228" "-4.1 " "6,671,809" ...
## $ Burglary : chr "1,992,895" "1,820,544" "-8.6 " "1,460,169" ...
## $ Larceny..theft : chr "5,816,991" "5,665,392" "-2.6 " "4,655,398" ...
## $ Motor..vehicle..theft : chr "697,980" "674,292" "-3.4 " "556,242" ...
## $ Arson : chr "51,126" "44,245" "-13.5 " "38,974" ...
## $ Number..of..agencies : chr "" "15,232" "" " " ...
## $ X2013..estimated..population : chr "" "299,269,511" "" "" ...
## $ X.1 : logi NA NA NA NA NA NA ...
## $ X.2 : logi NA NA NA NA NA NA ...
## $ X.3 : logi NA NA NA NA NA NA ...
Subsetting the Imported Data Set
The imported data set has extra columns and rows that are not needed in this analysis. For example, I only need columns from Population.group to Arson. For the rows, I need to remove the values with the Percent change values from column X. Both of these tasks are accomplished by using the dplyr functions select and filter, respectively.
#Subsetting columns
mydata <- select(mydata, Population.group:Arson)
head(mydata)
## Population.group X Violent..crime
## 1 TOTAL ALL AGENCIES: 2012 1,145,272
## 2 2013 1,095,149
## 3 Percent change -4.4
## 4 TOTAL CITIES 2012 919,218
## 5 2013 877,594
## 6 Percent change -4.5
## Murder.and..nonnegligent..manslaughter Forcible..rape1 Robbery
## 1 14,349 65,733 345,758
## 2 13,716 62,034 335,428
## 3 -4.4 -5.6 -3.0
## 4 11,198 50,003 303,475
## 5 10,511 47,606 294,292
## 6 -6.1 -4.8 -3.0
## Aggravated..assault Property..crime Burglary Larceny..theft
## 1 719,432 8,507,866 1,992,895 5,816,991
## 2 683,971 8,160,228 1,820,544 5,665,392
## 3 -4.9 -4.1 -8.6 -2.6
## 4 554,542 6,671,809 1,460,169 4,655,398
## 5 525,185 6,434,879 1,335,527 4,557,867
## 6 -5.3 -3.6 -8.5 -2.1
## Motor..vehicle..theft Arson
## 1 697,980 51,126
## 2 674,292 44,245
## 3 -3.4 -13.5
## 4 556,242 38,974
## 5 541,485 33,432
## 6 -2.7 -14.2
#Subsetting rows
mydata <- filter(mydata, X != "Percent change")
head(mydata)
## Population.group X Violent..crime
## 1 TOTAL ALL AGENCIES: 2012 1,145,272
## 2 2013 1,095,149
## 3 TOTAL CITIES 2012 919,218
## 4 2013 877,594
## 5 GROUP I (250,000 and over) 2012 416,885
## 6 2013 402,988
## Murder.and..nonnegligent..manslaughter Forcible..rape1 Robbery
## 1 14,349 65,733 345,758
## 2 13,716 62,034 335,428
## 3 11,198 50,003 303,475
## 4 10,511 47,606 294,292
## 5 5,897 15,715 167,168
## 6 5,356 15,522 162,815
## Aggravated..assault Property..crime Burglary Larceny..theft
## 1 719,432 8,507,866 1,992,895 5,816,991
## 2 683,971 8,160,228 1,820,544 5,665,392
## 3 554,542 6,671,809 1,460,169 4,655,398
## 4 525,185 6,434,879 1,335,527 4,557,867
## 5 228,105 2,155,161 493,768 1,401,823
## 6 219,295 2,097,875 454,980 1,395,583
## Motor..vehicle..theft Arson
## 1 697,980 51,126
## 2 674,292 44,245
## 3 556,242 38,974
## 4 541,485 33,432
## 5 259,570 12,945
## 6 247,312 12,150
Additional Subsetting
In the current data structure, several values are nested in a structure that is not ideal for analysis. For example the Population.group values are not carried through all rows. This pattern appears to be consistent. As a result, I use subsetting by Recycling to extract those values and add them to the column1 vector. I then repeat each value in the column1 vector two times so they can be appended back at a later stage.
column1 <- mydata$Population.group[c(TRUE, FALSE)]
column1 <- rep(column1, each = 2)
head(column1)
## [1] "TOTAL ALL AGENCIES:" "TOTAL ALL AGENCIES:"
## [3] "TOTAL CITIES" "TOTAL CITIES"
## [5] "GROUP I (250,000 and over)" "GROUP I (250,000 and over)"
mydata[ ,"Population.group"] <- NULL
mydata[ ,"Population.group"] <- column1
head(mydata)
## X Violent..crime Murder.and..nonnegligent..manslaughter
## 1 2012 1,145,272 14,349
## 2 2013 1,095,149 13,716
## 3 2012 919,218 11,198
## 4 2013 877,594 10,511
## 5 2012 416,885 5,897
## 6 2013 402,988 5,356
## Forcible..rape1 Robbery Aggravated..assault Property..crime Burglary
## 1 65,733 345,758 719,432 8,507,866 1,992,895
## 2 62,034 335,428 683,971 8,160,228 1,820,544
## 3 50,003 303,475 554,542 6,671,809 1,460,169
## 4 47,606 294,292 525,185 6,434,879 1,335,527
## 5 15,715 167,168 228,105 2,155,161 493,768
## 6 15,522 162,815 219,295 2,097,875 454,980
## Larceny..theft Motor..vehicle..theft Arson Population.group
## 1 5,816,991 697,980 51,126 TOTAL ALL AGENCIES:
## 2 5,665,392 674,292 44,245 TOTAL ALL AGENCIES:
## 3 4,655,398 556,242 38,974 TOTAL CITIES
## 4 4,557,867 541,485 33,432 TOTAL CITIES
## 5 1,401,823 259,570 12,945 GROUP I (250,000 and over)
## 6 1,395,583 247,312 12,150 GROUP I (250,000 and over)
Column Names
Rename the columns to give them shorter, more user-friendly names. I also made sure to add underscores in between the words so the new column name do not cause issues with the deplyer mutate functions.
colnames(mydata) <- c("Date", "Violent_Crime", "Murder", "Rape", "Robbery", "Assault", "Property_Crime", "Burglary", "Theft", "Auto_Theft", "Arson", "Population_Groups")
head(mydata)
## Date Violent_Crime Murder Rape Robbery Assault Property_Crime
## 1 2012 1,145,272 14,349 65,733 345,758 719,432 8,507,866
## 2 2013 1,095,149 13,716 62,034 335,428 683,971 8,160,228
## 3 2012 919,218 11,198 50,003 303,475 554,542 6,671,809
## 4 2013 877,594 10,511 47,606 294,292 525,185 6,434,879
## 5 2012 416,885 5,897 15,715 167,168 228,105 2,155,161
## 6 2013 402,988 5,356 15,522 162,815 219,295 2,097,875
## Burglary Theft Auto_Theft Arson Population_Groups
## 1 1,992,895 5,816,991 697,980 51,126 TOTAL ALL AGENCIES:
## 2 1,820,544 5,665,392 674,292 44,245 TOTAL ALL AGENCIES:
## 3 1,460,169 4,655,398 556,242 38,974 TOTAL CITIES
## 4 1,335,527 4,557,867 541,485 33,432 TOTAL CITIES
## 5 493,768 1,401,823 259,570 12,945 GROUP I (250,000 and over)
## 6 454,980 1,395,583 247,312 12,150 GROUP I (250,000 and over)
str(mydata)
## 'data.frame': 28 obs. of 12 variables:
## $ Date : chr "2012" "2013" "2012" "2013" ...
## $ Violent_Crime : chr "1,145,272" "1,095,149" "919,218" "877,594" ...
## $ Murder : chr "14,349" "13,716" "11,198" "10,511" ...
## $ Rape : chr "65,733" "62,034" "50,003" "47,606" ...
## $ Robbery : chr "345,758" "335,428" "303,475" "294,292" ...
## $ Assault : chr "719,432" "683,971" "554,542" "525,185" ...
## $ Property_Crime : chr "8,507,866" "8,160,228" "6,671,809" "6,434,879" ...
## $ Burglary : chr "1,992,895" "1,820,544" "1,460,169" "1,335,527" ...
## $ Theft : chr "5,816,991" "5,665,392" "4,655,398" "4,557,867" ...
## $ Auto_Theft : chr "697,980" "674,292" "556,242" "541,485" ...
## $ Arson : chr "51,126" "44,245" "38,974" "33,432" ...
## $ Population_Groups: chr "TOTAL ALL AGENCIES:" "TOTAL ALL AGENCIES:" "TOTAL CITIES" "TOTAL CITIES" ...
Gather
Columns 2:11 represent types of crimes and make the data set very wide. I use the tidyr function gather to collapse those columns into a new column called “Types_of_Crimes”. This should make my downstream analysis easier.
mydata1 <- gather(mydata, "Types_of_Crimes", "Counts", 2:11)
head(mydata1)
## Date Population_Groups Types_of_Crimes Counts
## 1 2012 TOTAL ALL AGENCIES: Violent_Crime 1,145,272
## 2 2013 TOTAL ALL AGENCIES: Violent_Crime 1,095,149
## 3 2012 TOTAL CITIES Violent_Crime 919,218
## 4 2013 TOTAL CITIES Violent_Crime 877,594
## 5 2012 GROUP I (250,000 and over) Violent_Crime 416,885
## 6 2013 GROUP I (250,000 and over) Violent_Crime 402,988
Spread
The annual dates, 2012 and 2013, are in the Date column and make any Year-Over-Year calculations more difficult. I use the tidyr function spread to make each date value its own column.
mydata2 <- spread(mydata1, Date, Counts)
head(mydata2)
## Population_Groups Types_of_Crimes 2012 2013
## 1 1,000,000 and over (Group I subset) Violent_Crime 166,007 161,252
## 2 1,000,000 and over (Group I subset) Murder 2,255 1,930
## 3 1,000,000 and over (Group I subset) Rape 5,254 5,356
## 4 1,000,000 and over (Group I subset) Robbery 74,843 71,478
## 5 1,000,000 and over (Group I subset) Assault 83,655 82,488
## 6 1,000,000 and over (Group I subset) Property_Crime 783,251 760,143
str(mydata2)
## 'data.frame': 140 obs. of 4 variables:
## $ Population_Groups: chr "1,000,000 and over (Group I subset)" "1,000,000 and over (Group I subset)" "1,000,000 and over (Group I subset)" "1,000,000 and over (Group I subset)" ...
## $ Types_of_Crimes : Factor w/ 10 levels "Violent_Crime",..: 1 2 3 4 5 6 7 8 9 10 ...
## $ 2012 : chr "166,007" "2,255" "5,254" "74,843" ...
## $ 2013 : chr "161,252" "1,930" "5,356" "71,478" ...
Converting Characters to Numeric
My data is almost ready for analysis, but the analysis values are still characters. I need to convert them to numeric before any analysis can be done. There are two steps in this process. The first step is to remove the comma for the digit characters. The second step is to take the “clean” digit characters, without the comma, and coerce them to numeric.
Y2012 <- unlist(str_replace_all(mydata2$`2012`, ",", ""))
Y2012 <- as.numeric(Y2012)
head(Y2012)
## [1] 166007 2255 5254 74843 83655 783251
str(Y2012)
## num [1:140] 166007 2255 5254 74843 83655 ...
Y2013 <- unlist(str_replace_all(mydata2$`2013`, ",", ""))
Y2013 <- as.numeric(Y2013)
head(Y2013)
## [1] 161252 1930 5356 71478 82488 760143
str(Y2013)
## num [1:140] 161252 1930 5356 71478 82488 ...
Removing & Appending Columns
In the prior step, I converted the digit characters to numeric via coercion and added two new date vectors, Y2012 and Y2013. I now remove the old date vectors and append the new numeric vectors to the data frame.
mydata2[ ,"2012"] <- NULL
mydata2[ ,"2013"] <- NULL
#Added the Y to make the year a character. If this step is not done, then the mutate function will not work correctly.
mydata2[ ,"Y2012"] <- Y2012
mydata2[ ,"Y2013"] <- Y2013
head(mydata2)
## Population_Groups Types_of_Crimes Y2012 Y2013
## 1 1,000,000 and over (Group I subset) Violent_Crime 166007 161252
## 2 1,000,000 and over (Group I subset) Murder 2255 1930
## 3 1,000,000 and over (Group I subset) Rape 5254 5356
## 4 1,000,000 and over (Group I subset) Robbery 74843 71478
## 5 1,000,000 and over (Group I subset) Assault 83655 82488
## 6 1,000,000 and over (Group I subset) Property_Crime 783251 760143
str(mydata2)
## 'data.frame': 140 obs. of 4 variables:
## $ Population_Groups: chr "1,000,000 and over (Group I subset)" "1,000,000 and over (Group I subset)" "1,000,000 and over (Group I subset)" "1,000,000 and over (Group I subset)" ...
## $ Types_of_Crimes : Factor w/ 10 levels "Violent_Crime",..: 1 2 3 4 5 6 7 8 9 10 ...
## $ Y2012 : num 166007 2255 5254 74843 83655 ...
## $ Y2013 : num 161252 1930 5356 71478 82488 ...
Subsetting by Crimes
As mentioned earlier, I will focus on Property and Violent Crimes in this analysis. In this section I use the dplyr filter function to subset the data into two data frames, one for each crime type.
#crime1 = mydata2 subset by Violent_crime
vcrime <- filter(mydata2, Types_of_Crimes == "Violent_Crime")
vcrime
## Population_Groups Types_of_Crimes Y2012 Y2013
## 1 1,000,000 and over (Group I subset) Violent_Crime 166007 161252
## 2 250,000 to 499,999 (Group I subset) Violent_Crime 112439 107520
## 3 500,000 to 999,999 (Group I subset) Violent_Crime 138439 134216
## 4 GROUP I (250,000 and over) Violent_Crime 416885 402988
## 5 GROUP II (100,000 to 249,999) Violent_Crime 154144 145408
## 6 GROUP III (50,000 to 99,999) Violent_Crime 116180 110033
## 7 GROUP IV (25,000 to 49,999) Violent_Crime 85900 80441
## 8 GROUP V (10,000 to 24,999) Violent_Crime 77759 73998
## 9 GROUP VI (under 10,000) Violent_Crime 68350 64726
## 10 METROPOLITAN COUNTIES Violent_Crime 183662 177318
## 11 NONMETROPOLITAN COUNTIES2 Violent_Crime 42392 40237
## 12 SUBURBAN AREAS3 Violent_Crime 326107 312046
## 13 TOTAL ALL AGENCIES: Violent_Crime 1145272 1095149
## 14 TOTAL CITIES Violent_Crime 919218 877594
#crime2 = mydata2 subset by Property_Crime
pcrime <- filter(mydata2, Types_of_Crimes == "Property_Crime")
pcrime
## Population_Groups Types_of_Crimes Y2012 Y2013
## 1 1,000,000 and over (Group I subset) Property_Crime 783251 760143
## 2 250,000 to 499,999 (Group I subset) Property_Crime 624902 604449
## 3 500,000 to 999,999 (Group I subset) Property_Crime 747008 733283
## 4 GROUP I (250,000 and over) Property_Crime 2155161 2097875
## 5 GROUP II (100,000 to 249,999) Property_Crime 1167627 1130942
## 6 GROUP III (50,000 to 99,999) Property_Crime 977397 942519
## 7 GROUP IV (25,000 to 49,999) Property_Crime 836125 806275
## 8 GROUP V (10,000 to 24,999) Property_Crime 817630 778955
## 9 GROUP VI (under 10,000) Property_Crime 717869 678313
## 10 METROPOLITAN COUNTIES Property_Crime 1461686 1380837
## 11 NONMETROPOLITAN COUNTIES2 Property_Crime 374371 344512
## 12 SUBURBAN AREAS3 Property_Crime 3023845 2865297
## 13 TOTAL ALL AGENCIES: Property_Crime 8507866 8160228
## 14 TOTAL CITIES Property_Crime 6671809 6434879
Mutate
The data is now ready for some analysis. In this section, I create a new Year-Over-Year trend variable for each crime type data frame. I do this using the dplyr mutate function.
#Creating the Violent_Crime_Trends variable from the violent crimes data frame subset
vcrime1 <- vcrime %>% mutate(Violent_Crime_Trends = round((((Y2013 / Y2012)-1)*100),2))
head(vcrime1)
## Population_Groups Types_of_Crimes Y2012 Y2013
## 1 1,000,000 and over (Group I subset) Violent_Crime 166007 161252
## 2 250,000 to 499,999 (Group I subset) Violent_Crime 112439 107520
## 3 500,000 to 999,999 (Group I subset) Violent_Crime 138439 134216
## 4 GROUP I (250,000 and over) Violent_Crime 416885 402988
## 5 GROUP II (100,000 to 249,999) Violent_Crime 154144 145408
## 6 GROUP III (50,000 to 99,999) Violent_Crime 116180 110033
## Violent_Crime_Trends
## 1 -2.86
## 2 -4.37
## 3 -3.05
## 4 -3.33
## 5 -5.67
## 6 -5.29
#Creating the Property_Crime_Trends variable from the property crimes data frame subset
pcrime1 <- pcrime %>% mutate(Property_Crime_Trends = round((((Y2013 / Y2012)-1)*100),2))
head(pcrime1)
## Population_Groups Types_of_Crimes Y2012 Y2013
## 1 1,000,000 and over (Group I subset) Property_Crime 783251 760143
## 2 250,000 to 499,999 (Group I subset) Property_Crime 624902 604449
## 3 500,000 to 999,999 (Group I subset) Property_Crime 747008 733283
## 4 GROUP I (250,000 and over) Property_Crime 2155161 2097875
## 5 GROUP II (100,000 to 249,999) Property_Crime 1167627 1130942
## 6 GROUP III (50,000 to 99,999) Property_Crime 977397 942519
## Property_Crime_Trends
## 1 -2.95
## 2 -3.27
## 3 -1.84
## 4 -2.66
## 5 -3.14
## 6 -3.57
Select
In the previous step, I introduced a new Crime Trend variable. I now subset data frames by a few columns using the dplyr select function. I also include the new Crime Trend Variables.
#Selecting a few columns from the vcrime1 data frame
vcrime2 <- select(vcrime1, Population_Groups, Violent_Crime_Trends)
head(vcrime2)
## Population_Groups Violent_Crime_Trends
## 1 1,000,000 and over (Group I subset) -2.86
## 2 250,000 to 499,999 (Group I subset) -4.37
## 3 500,000 to 999,999 (Group I subset) -3.05
## 4 GROUP I (250,000 and over) -3.33
## 5 GROUP II (100,000 to 249,999) -5.67
## 6 GROUP III (50,000 to 99,999) -5.29
#Selecting a few columns from the pcrime1 data frame
pcrime2 <- select(pcrime1, Population_Groups, Property_Crime_Trends)
head(pcrime2)
## Population_Groups Property_Crime_Trends
## 1 1,000,000 and over (Group I subset) -2.95
## 2 250,000 to 499,999 (Group I subset) -3.27
## 3 500,000 to 999,999 (Group I subset) -1.84
## 4 GROUP I (250,000 and over) -2.66
## 5 GROUP II (100,000 to 249,999) -3.14
## 6 GROUP III (50,000 to 99,999) -3.57
Inner Join
Now that I have Crime Trends for both Violent and Property crimes, the next step is to compare these two trends side-by-side. I use the dplyr inner_join function to join the two data frames and get the trend variable from each data frame side-by-side. Both data frames have the same Population_Groups values so rows will not be dropped.
inner_join(vcrime2, pcrime2, by = "Population_Groups")
## Population_Groups Violent_Crime_Trends
## 1 1,000,000 and over (Group I subset) -2.86
## 2 250,000 to 499,999 (Group I subset) -4.37
## 3 500,000 to 999,999 (Group I subset) -3.05
## 4 GROUP I (250,000 and over) -3.33
## 5 GROUP II (100,000 to 249,999) -5.67
## 6 GROUP III (50,000 to 99,999) -5.29
## 7 GROUP IV (25,000 to 49,999) -6.36
## 8 GROUP V (10,000 to 24,999) -4.84
## 9 GROUP VI (under 10,000) -5.30
## 10 METROPOLITAN COUNTIES -3.45
## 11 NONMETROPOLITAN COUNTIES2 -5.08
## 12 SUBURBAN AREAS3 -4.31
## 13 TOTAL ALL AGENCIES: -4.38
## 14 TOTAL CITIES -4.53
## Property_Crime_Trends
## 1 -2.95
## 2 -3.27
## 3 -1.84
## 4 -2.66
## 5 -3.14
## 6 -3.57
## 7 -3.57
## 8 -4.73
## 9 -5.51
## 10 -5.53
## 11 -7.98
## 12 -5.24
## 13 -4.09
## 14 -3.55
pcrime2
## Population_Groups Property_Crime_Trends
## 1 1,000,000 and over (Group I subset) -2.95
## 2 250,000 to 499,999 (Group I subset) -3.27
## 3 500,000 to 999,999 (Group I subset) -1.84
## 4 GROUP I (250,000 and over) -2.66
## 5 GROUP II (100,000 to 249,999) -3.14
## 6 GROUP III (50,000 to 99,999) -3.57
## 7 GROUP IV (25,000 to 49,999) -3.57
## 8 GROUP V (10,000 to 24,999) -4.73
## 9 GROUP VI (under 10,000) -5.51
## 10 METROPOLITAN COUNTIES -5.53
## 11 NONMETROPOLITAN COUNTIES2 -7.98
## 12 SUBURBAN AREAS3 -5.24
## 13 TOTAL ALL AGENCIES: -4.09
## 14 TOTAL CITIES -3.55
Based on the analysis, it appears that crime has decreased for both property and violent crimes across all population groups between 2012 and 2013.