We removed the following dimensions from the original dataset. They include the following:
1) Parent Institution - we removed this dimension because this information could be summarized by the county data, and we didn't want our data broken down by institution, we cared more about the region it was in.
2) Holding Offense - we removed this dimension because it was more succintly summarized in the Offense Type dimension.
3) Holding Offense Category - we removed this dimension because it was more succintly summarized in the Offense Type dimension.
4) Sentence Months - we removed this dimension because we added it into our sentence years dimension so all of the time served could be one dimension.
5) IDOC # - this column was filtered out when we imported the data since it wasn't necessary/helpful for any analysis
6) Name - this column was filtered out when we imported the data since it wasn't necessary/helpful for any analysis
7) Date of Birth - this column was removed because we used it to calculate age so it contained the same data as another dimension
We added the following dimensions to the original dataset. They include the following:
1) Age at Sentencing - this was calculated by taking the difference between the difference between the sentencing date and the date of birth.
2) Life - in the Sentence Years dimension, some of them would say "LIFE" instead of a number of years. We extracted the Life data into it's own column with a binary response.
3) Sexually Dangerous Person - in the Sentence Years dimension, some of them would say "SDP" instead of a number of years. We extracted the SDP data into it's own column with a binary response.
We had a lot of categorical variables that we transformed to dummy variables in Excel. They include the following:
1) Sex - there were only two response types for sex: "Male" and "Female". We created the dimension Female which was a 1 for the "Female" response and 0 if they are not "Female". If this variable is 0, that means "Male".
2) Race - there were 7 response types: "White", "Black", "Hispanic", "Asian", "American Indian", "Bi-Racial", and "Unknown". We created 6 dimensions of White, Black, Hispanic, Asian, AmericanIndian, and BiRacial, where the response was 1 if they were the corresponding race and 0 if they were not. If all of these dimensions are turned to 0, that means the race is "Unknown".
3) Veteran Status - there were 3 response types: "Yes", "No", and "Unknown". We created the dimensions Veteran and NotVeteran, where the response was 1 if they held the corresponding status and 0 if not. If these two dimensions are turned to 0, that means the veteran status is "Unknown".
4) Admission Type - there were 4 response types: "Court admissions", "New sentence violators", "Technical violators", and "Other". We created 3 dimensions of CourtAdmissions, NewSentenceViolators, and TechnicalViolators, where the response was 1 if they had the corresponding admission type and 0 if they did not. If all of these dimensions are turned to 0, that means the admission type is "Other".
5) Crime Class - there were 7 response types: "Class 1", "Class 2", "Class 3", "Class 4", "Class X", "Murder", and "Unclassified". We created 6 dimensions of Class1, Class2, Class3, Class4, ClassX, and Murder, where the response was 1 if they had the corresponding crime class and 0 if they did not. If all of these dimensions are turned to 0, that means the crime class is "Unclassified".
6) Offense Type - there were 5 response types: "Drug Crimes", "Person Crimes", "Property Crimes", "Sex Crimes", and "Other Crimes". We created 4 dimensions of DrugCrimes, PersonCrimes, SexCrimes, and PropertyCrimes, where the response was 1 if they had the corresponding offense type and 0 if they did not. If all of these dimensions are turned to 0, that means the offense type is "Other Crimes".
7) Sentence Years - there were 2 responses in this dimension that were not numerical, "LIFE" for a life sentence and "SDP" for a sexually dangerous person. We extracted each of these into their own columns with binary response and set the years to 120.
8) Truth in Sentencing - this data had quite a few response types, with "Day-for-Day", "100%", "85%", and "75%", where each of those categories were further split into a type of crime, for example, "85% Agg DUI w Death". The data this column conveyed was the minimum amount of their sentence the inmate would have to serve, so 75% means they have to serve at least 75% of their sentence length. Since we already had columns for types of crime, we chose to lump together each percentage category and ignore the type of crime with it. Thus, we created 3 dimensions of 100p, 85p, and 75p for "100%", "85%", and "75%" respectively, where the response was 1 if they had to serve the corresponding length of time and 0 if they did not. If all of these dimensions are turned to 0, that means the time to serve is "Day-by-Day".
9) Sentencing County - this data had a lot of response types since there are so many counties. We decided that we did care about the area since that could have an effect, but we don't need to break it up by every individual county. Instead, we decided to break it up into four regions, northeast, northwest, southeast, and southwest. We used a map to determine where each county fell to group them in their respective region. Thus, we created 3 dimensions of "Northeast", "Northwest", and "Southwest", where the response was 1 if they were in the corresponding region and 0 if they were not. If all of these dimensions are turned to 0, that means the region is "Southeast".
Age at Sentence - there were 4 nonsensical ages we calculated, likely due to error in the data set. We set these four values to NA.
Dates - for Projected MSR Date and Projected Discharge Date, there were values of 0, which was due to missing data. We set these values to NA.
Important Note:
Dates are stored as sequential serial numbers so that they can be used in calculation. By default, January 1, 1900 is Serial number 1. Serial number 39448 would be January 1, 2008 because it is 39,477 days after January 1, 1900.
Since nearly all of our data was categorical, the main transformation we did was converting our categorical variables to dummy variables with binary response. Beyond that, we didn't feel that it was appropriate to transform any of our data. For our non-binary variables, we do not think transformations are necessary. These dimensions are explored in univariate and bivariate analysis for why we don't think we need to transform. Some reasons that someone might choose to transform data are to improve interpretability, de-clutter graphs, and get insight about the relationship between variables. We don't believe that any of these supposed benefits can be achieved by transforming our data further.
library(readxl)
PrisonData <- read_excel("C:/Users/Sarah Chock/OneDrive - University of St. Thomas/Senior Year/STAT 360 Comp Stat and Data Analysis/Project/Project Data/FinalProjectDataV5.xlsx")
FinalProjectData <- as.matrix(PrisonData[,3:39])
head(FinalProjectData)
## Female White Black Hispanic Asian American Indian BiRacial Veteran
## [1,] 0 1 0 0 0 0 0 1
## [2,] 0 0 1 0 0 0 0 0
## [3,] 0 0 1 0 0 0 0 0
## [4,] 0 0 1 0 0 0 0 0
## [5,] 0 0 1 0 0 0 0 0
## [6,] 0 0 1 0 0 0 0 0
## NotVeteran CurrentAdmissionDate CourtAdmissions NewSentenceViolators
## [1,] 0 30363 1 0
## [2,] 1 32500 0 1
## [3,] 1 27082 1 0
## [4,] 1 30575 0 1
## [5,] 1 38699 1 0
## [6,] 1 36784 0 0
## TechnicalViolators ProjectedMSRDate ProjectedDischargeDate CustodyDate
## [1,] 0 48544 49639 30281
## [2,] 0 60493 61589 31684
## [3,] 0 0 0 30006
## [4,] 0 0 0 30054
## [5,] 0 0 0 36071
## [6,] 0 0 0 31932
## SentenceDate Class1 Class2 Class3 Class4 ClassX Murder PersonCrimes
## [1,] 30362 0 0 0 0 1 0 1
## [2,] 31996 0 0 0 0 1 0 0
## [3,] 30006 0 0 0 0 0 1 1
## [4,] 30574 0 0 0 0 0 1 1
## [5,] 38695 0 0 0 0 0 1 1
## [6,] 32881 0 0 0 0 0 1 1
## SexCrimes DrugCrimes PropertyCrimes LifeSentence SexuallyDangerousPerson
## [1,] 0 0 0 0 0
## [2,] 1 0 0 0 0
## [3,] 0 0 0 1 0
## [4,] 0 0 0 1 0
## [5,] 0 0 0 1 0
## [6,] 0 0 0 1 0
## SentenceYears 100p 85p 75p AgeAtSentence Northwest Southwest Northeast
## [1,] 50 0 0 0 33.67283 0 0 0
## [2,] 60 0 0 0 33.36893 0 0 1
## [3,] 120 0 0 0 26.11910 0 0 1
## [4,] 120 0 0 0 30.45038 0 0 1
## [5,] 120 0 0 0 50.85010 0 0 1
## [6,] 120 0 0 0 44.97194 0 0 1
# Fix Ages
FinalProjectData[which(FinalProjectData[,34]<5),34] <- NA
# Fix Projected MSR Date
FinalProjectData[which(FinalProjectData[,14]<1),14] <- NA
# Fix Projected Discharge Date
FinalProjectData[which(FinalProjectData[,15]<1),15] <- NA
summary(FinalProjectData)
## Female White Black Hispanic
## Min. :0.00000 Min. :0.0000 Min. :0.0000 Min. :0.0000
## 1st Qu.:0.00000 1st Qu.:0.0000 1st Qu.:0.0000 1st Qu.:0.0000
## Median :0.00000 Median :0.0000 Median :1.0000 Median :0.0000
## Mean :0.04682 Mean :0.3164 Mean :0.5441 Mean :0.1309
## 3rd Qu.:0.00000 3rd Qu.:1.0000 3rd Qu.:1.0000 3rd Qu.:0.0000
## Max. :1.00000 Max. :1.0000 Max. :1.0000 Max. :1.0000
##
## Asian American Indian BiRacial Veteran
## Min. :0.000000 Min. :0.000000 Min. :0.000000 Min. :0.00000
## 1st Qu.:0.000000 1st Qu.:0.000000 1st Qu.:0.000000 1st Qu.:0.00000
## Median :0.000000 Median :0.000000 Median :0.000000 Median :0.00000
## Mean :0.003734 Mean :0.001329 Mean :0.001975 Mean :0.02661
## 3rd Qu.:0.000000 3rd Qu.:0.000000 3rd Qu.:0.000000 3rd Qu.:0.00000
## Max. :1.000000 Max. :1.000000 Max. :1.000000 Max. :1.00000
##
## NotVeteran CurrentAdmissionDate CourtAdmissions NewSentenceViolators
## Min. :0.0000 Min. :23154 Min. :0.0000 Min. :0.00000
## 1st Qu.:0.0000 1st Qu.:40822 1st Qu.:1.0000 1st Qu.:0.00000
## Median :1.0000 Median :43336 Median :1.0000 Median :0.00000
## Mean :0.6012 Mean :42073 Mean :0.8648 Mean :0.05296
## 3rd Qu.:1.0000 3rd Qu.:44336 3rd Qu.:1.0000 3rd Qu.:0.00000
## Max. :1.0000 Max. :44560 Max. :1.0000 Max. :1.00000
##
## TechnicalViolators ProjectedMSRDate ProjectedDischargeDate CustodyDate
## Min. :0.00000 Min. :28957 Min. :44293 Min. :23024
## 1st Qu.:0.00000 1st Qu.:44831 1st Qu.:45572 1st Qu.:39909
## Median :0.00000 Median :45487 Median :46356 Median :42576
## Mean :0.07835 Mean :47219 Mean :48003 Mean :41405
## 3rd Qu.:0.00000 3rd Qu.:47720 3rd Qu.:48454 3rd Qu.:43786
## Max. :1.00000 Max. :65379 Max. :65368 Max. :44552
## NA's :2178 NA's :5055
## SentenceDate Class1 Class2 Class3
## Min. :23110 Min. :0.0000 Min. :0.0000 Min. :0.00000
## 1st Qu.:40738 1st Qu.:0.0000 1st Qu.:0.0000 1st Qu.:0.00000
## Median :43180 Median :0.0000 Median :0.0000 Median :0.00000
## Mean :41958 Mean :0.1231 Mean :0.1723 Mean :0.07339
## 3rd Qu.:44187 3rd Qu.:0.0000 3rd Qu.:0.0000 3rd Qu.:0.00000
## Max. :44552 Max. :1.0000 Max. :1.0000 Max. :1.00000
##
## Class4 ClassX Murder PersonCrimes
## Min. :0.00000 Min. :0.0000 Min. :0.000 Min. :0.0000
## 1st Qu.:0.00000 1st Qu.:0.0000 1st Qu.:0.000 1st Qu.:0.0000
## Median :0.00000 Median :0.0000 Median :0.000 Median :1.0000
## Mean :0.05257 Mean :0.3502 Mean :0.223 Mean :0.6105
## 3rd Qu.:0.00000 3rd Qu.:1.0000 3rd Qu.:0.000 3rd Qu.:1.0000
## Max. :1.00000 Max. :1.0000 Max. :1.000 Max. :1.0000
##
## SexCrimes DrugCrimes PropertyCrimes LifeSentence
## Min. :0.0000 Min. :0.0000 Min. :0.00000 Min. :0.00000
## 1st Qu.:0.0000 1st Qu.:0.0000 1st Qu.:0.00000 1st Qu.:0.00000
## Median :0.0000 Median :0.0000 Median :0.00000 Median :0.00000
## Mean :0.1805 Mean :0.1127 Mean :0.09019 Mean :0.05379
## 3rd Qu.:0.0000 3rd Qu.:0.0000 3rd Qu.:0.00000 3rd Qu.:0.00000
## Max. :1.0000 Max. :1.0000 Max. :1.00000 Max. :1.00000
##
## SexuallyDangerousPerson SentenceYears 100p 85p
## Min. :0.000000 Min. : 1.00 Min. :0.0000 Min. :0.0000
## 1st Qu.:0.000000 1st Qu.: 6.00 1st Qu.:0.0000 1st Qu.:0.0000
## Median :0.000000 Median : 12.00 Median :0.0000 Median :0.0000
## Mean :0.005422 Mean : 24.19 Mean :0.1625 Mean :0.3032
## 3rd Qu.:0.000000 3rd Qu.: 28.00 3rd Qu.:0.0000 3rd Qu.:1.0000
## Max. :1.000000 Max. :600.00 Max. :1.0000 Max. :1.0000
##
## 75p AgeAtSentence Northwest Southwest
## Min. :0.00000 Min. :14.98 Min. :0.0000 Min. :0.0000
## 1st Qu.:0.00000 1st Qu.:24.82 1st Qu.:0.0000 1st Qu.:0.0000
## Median :0.00000 Median :31.12 Median :0.0000 Median :0.0000
## Mean :0.01153 Mean :33.47 Mean :0.1315 Mean :0.1123
## 3rd Qu.:0.00000 3rd Qu.:39.93 3rd Qu.:0.0000 3rd Qu.:0.0000
## Max. :1.00000 Max. :83.83 Max. :1.0000 Max. :1.0000
## NA's :4
## Northeast
## Min. :0.000
## 1st Qu.:0.000
## Median :1.000
## Mean :0.652
## 3rd Qu.:1.000
## Max. :1.000
##
library(moments)
# Mean
meanfemale <- mean(FinalProjectData[,1])
meanfemale
## [1] 0.04682058
#Standard Deviation
sdfemale <- sd(FinalProjectData[,1])
sdfemale
## [1] 0.2112582
#Sample Variance
varfemale <- var(FinalProjectData[,1])
varfemale
## [1] 0.04463002
#Skewness
skewfemale <- skewness(FinalProjectData[,1])
skewfemale
## [1] 4.290367
#Kurtosis
kurtfemale <- kurtosis(FinalProjectData[,1])
kurtfemale
## [1] 19.40725
#1D Outliers
which(abs(scale(FinalProjectData[,1]))>3)
## [1] 631 632 633 634 635 1078 1079 1080 1081 1082 1083 1084
## [13] 1085 1086 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925
## [25] 1926 1927 2766 3849 3862 3863 3864 3865 3866 3867 3868 3869
## [37] 3870 3871 3872 3873 5539 5540 5541 5542 5543 5544 5545 5546
## [49] 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558
## [61] 5559 5560 5561 5562 5839 5840 5841 5842 5843 5844 5845 5846
## [73] 5847 5848 5849 5850 5851 5852 5853 11278 11529 11666 12268 12269
## [85] 12270 12271 12272 12460 12461 12462 12670 12671 12672 14709 14710 14711
## [97] 14712 14713 14714 14715 14716 14717 14718 14719 14720 14721 14722 14723
## [109] 14724 14725 14726 14727 14728 14729 14730 14731 14732 14733 14734 14735
## [121] 14736 14737 14738 14739 14740 14741 14742 14743 14744 14745 14746 14747
## [133] 14748 14749 14750 14751 14752 14753 14754 14755 14756 14757 14758 14759
## [145] 14760 14761 14762 14763 14764 14765 14766 14767 14768 14769 14770 14771
## [157] 14772 14773 14774 14775 14776 14777 14778 14779 14780 14781 14782 14783
## [169] 14784 14785 14786 14787 14788 14789 14790 14791 14792 14793 14794 14795
## [181] 14796 14797 14798 17053 17054 17055 17056 17057 17058 17059 17060 17061
## [193] 17062 17063 17064 17065 17066 17067 17068 17069 17070 17071 17072 17073
## [205] 17074 17075 17076 17077 17078 17079 17080 17081 17082 17083 17084 17085
## [217] 17086 17087 17088 17089 17090 17091 17092 17093 17094 17095 17096 17097
## [229] 17098 17099 17100 17101 17102 17103 17104 17105 17106 17107 17108 17109
## [241] 17110 17111 17112 17113 17114 17115 17116 17117 17118 17119 17120 17121
## [253] 17122 17123 17124 17125 17126 17127 17128 17129 17130 17131 17132 17133
## [265] 17134 17135 17136 17137 17138 17139 17140 17141 17142 17143 17144 17145
## [277] 17146 17147 17148 17149 17150 17151 17152 17153 17154 17155 17156 17157
## [289] 17158 17159 17160 17161 17162 17163 17164 17165 17166 17167 17168 17169
## [301] 17170 17171 17172 17173 17174 17175 17176 17177 17178 17179 17180 17181
## [313] 17182 17183 17184 17185 17186 17187 17188 17189 17190 17191 17192 17193
## [325] 17194 17195 17196 17197 17198 17199 17200 17201 17202 17203 17204 17205
## [337] 17206 17207 17208 17209 17210 17211 17212 17213 17214 17215 17216 17217
## [349] 17218 17219 17220 17221 17222 17223 17224 17225 17226 17227 17228 17229
## [361] 17230 17231 17232 17233 17234 17235 17236 17237 17238 17239 17240 17241
## [373] 17242 17243 17244 17245 17246 17247 17248 17249 17250 17251 17252 17253
## [385] 17254 17255 17256 17257 17258 17259 17260 17261 17262 17263 17264 17265
## [397] 17266 17267 17268 17269 17270 17271 17272 17273 17274 17275 17276 17277
## [409] 17278 17279 17280 17281 17282 17283 17284 17285 17286 17287 17288 17289
## [421] 17290 17291 17292 17293 17294 17295 17296 17297 17298 17299 17300 17301
## [433] 17302 17303 17304 17305 17306 17307 17308 17309 17310 17311 17312 17313
## [445] 17314 17315 17316 17317 17318 17319 17320 17321 17322 17323 17324 17325
## [457] 17326 17327 17328 17329 17330 17331 17332 17333 17334 17335 17336 17337
## [469] 17338 17339 17340 17341 17342 17343 17344 17345 17346 17347 17348 17349
## [481] 17350 17351 17352 17353 17354 17355 17356 17357 17358 17359 17360 17361
## [493] 17362 17363 17364 17365 17366 17367 17368 17369 17370 17371 17372 17373
## [505] 17374 17375 17376 17377 17378 17379 17380 17381 17382 17383 17384 17385
## [517] 17386 17387 17388 17389 17390 17391 17392 17393 17394 17395 17396 17397
## [529] 17398 17399 17400 17401 17402 17403 17404 17405 17406 17407 17408 17409
## [541] 17410 17411 17412 17413 17414 17415 17416 17417 17418 17419 17420 17421
## [553] 17422 17423 17424 17425 17426 17427 17428 17429 17430 17431 17432 17433
## [565] 17434 17435 17436 17437 17438 17439 17440 17441 17442 17443 17444 17445
## [577] 17446 17447 17448 17449 17450 17451 17452 17453 17454 17455 17456 17457
## [589] 17458 17459 17460 17461 17462 17463 17464 17465 17466 17467 17468 17469
## [601] 17470 17471 17472 17473 17474 17475 17476 17477 17478 19001 19002 19019
## [613] 19029 19036 19087 19089 19122 19133 19148 19165 19177 19181 19203 19252
## [625] 19301 19324 19339 19384 19411 19423 19424 19445 19475 19558 19559 19609
## [637] 19641 19663 19666 19683 19686 19753 19754 19817 19855 19859 19872 19885
## [649] 19887 19894 19895 19918 19919 19921 19931 19951 19992 19994 20021 20032
## [661] 20065 20089 20102 20125 20156 20186 20193 20221 20242 20261 20279 20283
## [673] 20320 20327 20328 20370 20381 20382 20412 20423 20452 20458 20463 20541
## [685] 20563 20610 20612 20616 20624 20632 20649 20656 20675 20828 20863 20865
## [697] 20889 20890 20996 21065 21066 21076 21093 21125 21162 21164 21179 21180
## [709] 21203 21213 21217 21226 21272 21279 21287 21312 21313 21315 21328 21329
## [721] 21334 21343 21415 21456 21457 21479 21505 21538 21546 21558 21560 21577
## [733] 21590 21594 21598 21600 21617 21620 21625 21645 21682 21695 21696 21738
## [745] 21796 21800 21816 21822 21852 21861 21867 21878 21880 21896 21929 21937
## [757] 21981 21998 21999 22037 22045 22046 22053 22068 22069 22070 22071 22085
## [769] 22087 22092 22111 22145 22160 22175 22197 22239 22241 22242 22250 22283
## [781] 22290 22323 22365 22375 22376 22385 22432 22452 22468 22481 22488 22495
## [793] 22507 22508 22552 22553 22554 22555 22560 22561 22582 22592 22621 22633
## [805] 22639 22659 22661 22675 22677 22710 22711 22728 22737 22750 22765 22802
## [817] 22809 22825 22826 22830 22832 22833 22864 22865 22871 22878 22892 22928
## [829] 22940 22941 22958 22970 22974 22991 22994 22995 23049 23050 23068 23075
## [841] 23083 23091 23111 23130 23149 23159 23177 23195 23200 23209 23251 23270
## [853] 23279 23310 23340 23353 23360 23363 23377 23378 23389 23429 23466 23467
## [865] 23470 23499 23500 23504 23511 23512 23518 23533 23542 23544 23547 23549
## [877] 23577 23579 23592 23602 23614 23615 23653 23660 23672 23676 23700 23711
## [889] 23713 23714 23715 23716 23717 23762 23763 23781 23787 23811 23813 23857
## [901] 23868 23869 23886 23901 23928 23929 23931 23932 23935 23978 23979 23998
## [913] 23999 24002 24010 24025 24027 24035 24040 24054 24070 24084 24095 24096
## [925] 24104 24134 24146 24158 24159 24165 24182 24188 24206 24269 24277 24281
## [937] 24289 24317 24344 24345 24348 24359 24361 24364 24378 24379 24385 24396
## [949] 24397 24398 24412 24413 24414 24421 24425 24439 24454 24476 24477 24478
## [961] 24479 24483 24491 24513 24535 24536 24550 24565 24572 24589 24590 24592
## [973] 24594 24596 24597 24603 24604 24605 24606 24642 24657 24658 24659 24676
## [985] 24688 24699 24729 24730 24742 24744 24745 24773 24774 24775 24777 24778
## [997] 24779 24795 24796 24813 24815 24817 24818 24843 24844 24845 24846 24856
## [1009] 24878 24885 24891 24896 24917 24927 24950 24970 24981 24990 25045 25086
## [1021] 25087 25099 25127 25128 25129 25161 25167 25169 25170 25187 25195 25196
## [1033] 25197 25222 25227 25228 25229 25286 25287 25288 25321 25322 25336 25342
## [1045] 25345 25349 25350 25385 25400 25407 25417 25426 25427 25428 25433 25438
## [1057] 25446 25447 25458 25462 25479 25489 25519 25520 25526 25561 25585 25600
## [1069] 25607 25609 25620 25632 25633 25635 25636 25637 25638 25639 25658 25659
## [1081] 25665 25678 25685 25716 25743 25748 25749 25750 25757 25758 25767 25768
## [1093] 25769 25776 25785 25821 25824 25871 25899 25905 25921 25928 25929 25947
## [1105] 25978 25980 25982 25991 25995 26007 26026 26032 26033 26040 26058 26059
## [1117] 26068 26069 26070 26076 26093 26151 26158 26159 26160 26161 26162 26163
## [1129] 26170 26171 26189 26196 26197 26222 26276 26287 26311 26322 26323 26325
## [1141] 26331 26345 26348 26349 26400 26401 26403 26432 26463 26464 26466 26479
## [1153] 26480 26525 26528 26533 26546 26548 26598 26603 26676 26678 26691 26692
## [1165] 26695 26696 26697 26698 26700 26712 26715 26716 26719 26739 26757 26764
## [1177] 26777 26778 26788 26798 26800 26813 26820 26821 26897 26899 26901 26918
## [1189] 26919 26922 26931 26932 26933 27038 27047 27048 27049 27050 27051 27052
## [1201] 27053 27054 27055 27056 27080 27082 27100 27102 27106 27107 27114 27115
## [1213] 27116 27117 27118 27127 27128 27129 27131 27135 27148 27149 27150 27151
## [1225] 27159 27161 27173 27179 27230 27240 27252 27253 27254 27257 27279 27288
## [1237] 27290 27304 27306 27312 27322 27323 27324 27325 27333 27334 27337 27350
## [1249] 27351 27352 27363 27364 27365 27400 27415 27416 27417 27426 27427 27431
## [1261] 27433 27434 27435 27436 27437 27438 27440 27443 27449 27450 27452 27454
## [1273] 27463 27464 27493 27500 27503 27505 27523 27528 27530 27531 27537 27551
## [1285] 27571 27572 27604 27606 27633 27634 27663 27711 27746 27747 27749 27750
## [1297] 27751 27752 27753 27763 27765 27766 27767 27768
# All of the females are considered outliers because there are so few of them.
#Plot
stripchart(FinalProjectData[,1], method = "stack")
# Mean
meanwhite <- mean(FinalProjectData[,2])
meanwhite
## [1] 0.316398
#Standard Deviation
sdwhite <- sd(FinalProjectData[,2])
sdwhite
## [1] 0.4650786
#Sample Variance
varwhite <- var(FinalProjectData[,2])
varwhite
## [1] 0.2162981
#Skewness
skewwhite <- skewness(FinalProjectData[,2])
skewwhite
## [1] 0.7895669
#Kurtosis
kurtwhite <- kurtosis(FinalProjectData[,2])
kurtwhite
## [1] 1.623416
#1D Outliers
which(abs(scale(FinalProjectData[,2]))>3)
## integer(0)
#Plot
stripchart(FinalProjectData[,2], method = "stack")
# Mean
meanblack <- mean(FinalProjectData[,3])
meanblack
## [1] 0.5440738
#Standard Deviation
sdblack <- sd(FinalProjectData[,3])
sdblack
## [1] 0.4980627
#Sample Variance
varblack <- var(FinalProjectData[,3])
varblack
## [1] 0.2480664
#Skewness
skewblack <- skewness(FinalProjectData[,3])
skewblack
## [1] -0.1769842
#Kurtosis
kurtblack <- kurtosis(FinalProjectData[,3])
kurtblack
## [1] 1.031323
#1D Outliers
which(abs(scale(FinalProjectData[,3]))>3)
## integer(0)
#Plot
stripchart(FinalProjectData[,3], method = "stack")
# Mean
meanhisp <- mean(FinalProjectData[,4])
meanhisp
## [1] 0.130875
#Standard Deviation
sdhisp <- sd(FinalProjectData[,4])
sdhisp
## [1] 0.3372697
#Sample Variance
varhisp <- var(FinalProjectData[,4])
varhisp
## [1] 0.1137508
#Skewness
skewhisp <- skewness(FinalProjectData[,4])
skewhisp
## [1] 2.18894
#Kurtosis
kurthisp <- kurtosis(FinalProjectData[,4])
kurthisp
## [1] 5.79146
#1D Outliers
which(abs(scale(FinalProjectData[,4]))>3)
## integer(0)
#Plot
stripchart(FinalProjectData[,4], method = "stack")
#Mean
meanasian <- mean(FinalProjectData[,5])
meanasian
## [1] 0.003734157
#Standard Deviation
sdasian <- sd(FinalProjectData[,5])
sdasian
## [1] 0.06099464
#Sample Variance
varasian <- var(FinalProjectData[,5])
varasian
## [1] 0.003720346
#Skewness
skewasian <- skewness(FinalProjectData[,5])
skewasian
## [1] 16.27273
#Kurtosis
kurtasian <- kurtosis(FinalProjectData[,5])
kurtasian
## [1] 265.8018
#1D Outliers
which(abs(scale(FinalProjectData[,5]))>3)
## [1] 1001 2661 3869 4037 4837 6532 6838 7121 7179 7342 7376 7558
## [13] 7689 7714 8061 8212 8220 8282 8348 8715 8804 8976 9006 9114
## [25] 9461 9959 9964 10000 10010 10087 10339 10464 10610 10927 11036 11142
## [37] 12086 12135 12352 12850 13275 13457 13578 13771 13827 14099 14424 14646
## [49] 14686 14719 14807 14893 14974 15017 15254 15309 15313 15776 16311 16463
## [61] 16578 16587 16640 16790 17138 17156 17191 17326 17351 19019 19329 19699
## [73] 20004 20243 20278 20588 20755 21145 21412 21493 21903 22180 22528 22614
## [85] 23296 23407 23452 23882 23971 23976 24619 25514 25581 25669 25715 25774
## [97] 25996 26110 26252 26541 27074 27282 27651 27751
# All of the Asian prisoners are considered outliers because there are so few of them.
#Plot
stripchart(FinalProjectData[,5], method = "stack")
#Mean
meanai <- mean(FinalProjectData[,6])
meanai
## [1] 0.001328498
#Standard Deviation
sdai <- sd(FinalProjectData[,6])
sdai
## [1] 0.036425
#Sample Variance
varai <- var(FinalProjectData[,6])
varai
## [1] 0.001326781
#Skewness
skewai <- skewness(FinalProjectData[,6])
skewai
## [1] 27.38122
#Kurtosis
kurtai <- kurtosis(FinalProjectData[,6])
kurtai
## [1] 750.7311
#1D Outliers
which(abs(scale(FinalProjectData[,6]))>3)
## [1] 552 710 1291 1812 1921 2476 3632 5607 5613 6404 8539 8648
## [13] 11495 12273 12724 13924 14730 15709 17045 17092 19003 19036 20196 21113
## [25] 21270 22167 23529 23722 23941 24165 24542 24555 25151 25702 26466 27108
## [37] 27214
# All of the American Indian prisoners are considered outliers because there are so few of them.
#Plot
stripchart(FinalProjectData[,6], method = "stack")
#Mean
meanbr <- mean(FinalProjectData[,7])
meanbr
## [1] 0.001974794
#Standard Deviation
sdbr <- sd(FinalProjectData[,7])
sdbr
## [1] 0.04439556
#Sample Variance
varbr <- var(FinalProjectData[,7])
varbr
## [1] 0.001970965
#Skewness
skewbr <- skewness(FinalProjectData[,7])
skewbr
## [1] 22.43622
#Kurtosis
kurtbr <- kurtosis(FinalProjectData[,7])
kurtbr
## [1] 504.3838
#1D Outliers
which(abs(scale(FinalProjectData[,7]))>3)
## [1] 6047 7445 15187 17073 17186 17238 18467 18636 19301 20070 20742 20977
## [13] 21598 21723 21738 21764 21891 22019 22053 22068 22070 22283 22361 22592
## [25] 23075 23255 23339 23363 23540 23559 24357 24832 25005 25063 25107 25163
## [37] 25202 25277 25401 25901 25920 26050 26200 26522 26539 26643 26751 26765
## [49] 26853 26949 27030 27495 27496 27782 27787
# All of the Bi-Racial prisoners are considered outliers because there are so few of them.
#Plot
stripchart(FinalProjectData[,7], method = "stack")
#Mean
meanvet <- mean(FinalProjectData[,8])
meanvet
## [1] 0.02660587
#Standard Deviation
sdvet <- sd(FinalProjectData[,8])
sdvet
## [1] 0.1609314
#Sample Variance
varvet <- var(FinalProjectData[,8])
varvet
## [1] 0.02589892
#Skewness
skewvet <- skewness(FinalProjectData[,8])
skewvet
## [1] 5.883284
#Kurtosis
kurtvet <- kurtosis(FinalProjectData[,8])
kurtvet
## [1] 35.61303
#1D Outliers
which(abs(scale(FinalProjectData[,8]))>3)
## [1] 1 35 45 47 52 53 58 60 61 87 96 100
## [13] 160 168 185 224 240 279 308 309 310 312 319 321
## [25] 326 370 378 379 395 432 445 519 608 610 613 654
## [37] 664 679 876 950 1092 1094 1109 1132 1134 1159 1170 1172
## [49] 1198 1234 1272 1283 1313 1320 1325 1357 1358 1388 1435 1466
## [61] 1507 1530 1569 1692 1841 1924 1934 2073 2156 2170 2256 2301
## [73] 2302 2349 2387 2403 2464 2538 2603 2627 2680 2772 2785 2914
## [85] 2950 2952 2966 2968 3005 3016 3044 3052 3055 3086 3097 3103
## [97] 3115 3127 3145 3156 3158 3202 3218 3232 3237 3241 3242 3244
## [109] 3251 3256 3282 3283 3301 3325 3328 3358 3372 3387 3404 3456
## [121] 3504 3518 3537 3634 3727 3777 3792 3814 3821 3826 3827 3841
## [133] 3850 3856 3879 3966 3968 3992 4023 4128 4132 4212 4240 4365
## [145] 4377 4522 4569 4610 4614 4635 4700 4708 4805 4836 4878 4880
## [157] 4988 5099 5242 5248 5304 5306 5328 5359 5382 5431 5480 5495
## [169] 5510 5567 5607 5619 5662 5666 5689 5743 5749 5753 5772 5776
## [181] 5798 5873 5876 5882 5900 5952 5978 5984 5989 6006 6038 6051
## [193] 6052 6055 6071 6085 6102 6110 6562 6665 6708 6811 6821 6839
## [205] 6934 6941 7197 7223 7424 7592 8132 8173 8190 8269 8341 8390
## [217] 8444 8479 8499 8593 8658 9340 9342 9407 9525 9559 9562 9681
## [229] 9848 9873 9882 9970 10082 10114 10193 10205 10473 10705 10758 10814
## [241] 10869 10887 11050 11181 11204 11212 11216 11230 11239 11262 11281 11293
## [253] 11306 11336 11340 11353 11357 11366 11386 11387 11397 11401 11402 11406
## [265] 11445 11453 11461 11467 11472 11475 11479 11480 11487 11503 11520 11528
## [277] 11536 11537 11545 11549 11565 11569 11580 11581 11625 11636 11644 11662
## [289] 11694 11735 11790 11830 11852 11853 11863 11872 11927 11929 11935 11951
## [301] 11958 11992 11993 12007 12008 12034 12051 12060 12071 12089 12093 12094
## [313] 12110 12118 12176 12177 12183 12185 12191 12195 12217 12252 12280 12325
## [325] 12329 12337 12338 12348 12422 12428 12438 12456 12459 12505 12525 12535
## [337] 12562 12568 12572 12578 12588 12589 12599 12624 12639 12653 12654 12657
## [349] 12660 12661 12673 12706 12707 12723 12737 12759 12780 12804 12831 12841
## [361] 12903 12939 12957 12992 13087 13217 13446 13481 13653 13663 13778 13801
## [373] 13895 13934 14002 14063 14078 14153 14179 14278 14347 14434 14621 14695
## [385] 14965 14969 14982 15065 15071 15102 15131 15212 15380 15467 15520 15835
## [397] 15863 15997 16092 16128 16170 16499 16580 16589 16607 16751 16802 16805
## [409] 16820 16877 17011 17053 17528 17577 17585 17587 17652 17655 17689 17727
## [421] 17740 17754 17873 17893 17928 17931 17950 18033 18036 18077 18081 18088
## [433] 18094 18107 18113 18116 18142 18157 18174 18181 18208 18213 18251 18254
## [445] 18257 18266 18276 18283 18294 18324 18338 18358 18365 18377 18410 18412
## [457] 18417 18431 18433 18442 18516 18534 18537 18551 18572 18613 18624 18626
## [469] 18635 18661 18676 18739 18743 18749 18771 18774 18780 18808 18809 18846
## [481] 18867 18878 18879 18892 18900 18901 18933 18956 18990 18993 19054 19074
## [493] 19082 19096 19255 19274 19277 19300 19333 19408 19558 19616 19661 19733
## [505] 19765 19830 19860 19863 19869 19989 19990 20101 20128 20349 20385 20423
## [517] 20457 20476 20562 20594 20622 20671 20687 20728 20885 20929 20947 20964
## [529] 20979 21048 21116 21117 21157 21211 21212 21237 21259 21270 21335 21336
## [541] 21376 21384 21507 21575 21586 21629 21678 21731 21743 21798 21855 22062
## [553] 22080 22159 22174 22206 22212 22249 22269 22289 22302 22347 22349 22378
## [565] 22399 22400 22404 22430 22445 22480 22513 22521 22544 22574 22581 22701
## [577] 22702 22712 22717 22813 22844 22887 22890 22906 22918 23002 23028 23119
## [589] 23121 23135 23139 23145 23154 23165 23193 23211 23267 23284 23306 23307
## [601] 23316 23320 23325 23341 23373 23375 23384 23424 23452 23494 23517 23520
## [613] 23553 23626 23631 23673 23725 23739 23749 23759 23767 23768 23789 23814
## [625] 23823 23837 23864 23919 23937 23954 23975 24031 24046 24048 24072 24144
## [637] 24153 24208 24209 24247 24298 24337 24338 24411 24457 24530 24539 24586
## [649] 24644 24647 24669 24707 24714 24746 24753 24814 24860 24879 24881 24884
## [661] 24942 24951 24977 24998 25024 25055 25065 25070 25075 25078 25091 25121
## [673] 25184 25252 25275 25291 25394 25405 25429 25441 25538 25549 25616 25644
## [685] 25670 25701 25706 25720 25733 25744 25780 25800 25819 25859 25892 25912
## [697] 25920 25954 26017 26020 26042 26062 26077 26097 26115 26203 26206 26216
## [709] 26335 26410 26435 26438 26481 26497 26522 26532 26538 26560 26763 26796
## [721] 26902 26934 26957 27034 27040 27061 27062 27075 27079 27120 27218 27344
## [733] 27356 27372 27414 27453 27520 27527 27545 27591 27645
# All of the veteran prisoners are considered outliers because there are so few of them.
#Plot
stripchart(FinalProjectData[,8], method = "stack")
#Mean
meannotvet <- mean(FinalProjectData[,9])
meannotvet
## [1] 0.6011992
#Standard Deviation
sdnotvet <- sd(FinalProjectData[,9])
sdnotvet
## [1] 0.4896604
#Sample Variance
varnotvet <- var(FinalProjectData[,9])
varnotvet
## [1] 0.2397673
#Skewness
skewnotvet <- skewness(FinalProjectData[,9])
skewnotvet
## [1] -0.413352
#Kurtosis
kurtnotvet <- kurtosis(FinalProjectData[,9])
kurtnotvet
## [1] 1.17086
#1D Outliers
which(abs(scale(FinalProjectData[,9]))>3)
## integer(0)
#Plot
stripchart(FinalProjectData[,9], method = "stack")
#Mean
meancuraddate <- mean(FinalProjectData[,10])
meancuraddate
## [1] 42072.98
#Standard Deviation
sdcuraddate <- sd(FinalProjectData[,10])
sdcuraddate
## [1] 3010.276
#Sample Variance
varcuraddate <- var(FinalProjectData[,10])
varcuraddate
## [1] 9061759
#Skewness
skewcuraddate <- skewness(FinalProjectData[,10])
skewcuraddate
## [1] -1.655884
#Kurtosis
kurtcuraddate <- kurtosis(FinalProjectData[,10])
kurtcuraddate
## [1] 5.61483
#1D Outliers
which(abs(scale(FinalProjectData[,10]))>3)
## [1] 1 2 3 4 7 8 9 10 11 12 13 14
## [13] 16 24 28 31 35 37 39 41 42 44 45 48
## [25] 49 51 53 56 63 64 65 66 67 68 69 71
## [37] 75 77 79 80 81 83 85 87 89 90 92 96
## [49] 97 98 99 112 113 115 116 117 118 121 122 128
## [61] 129 131 140 141 150 155 156 160 163 164 170 172
## [73] 173 181 183 187 188 190 193 196 197 200 201 205
## [85] 206 216 218 228 229 235 239 240 247 252 254 256
## [97] 257 260 270 274 278 283 284 285 293 295 305 309
## [109] 312 316 317 318 319 327 330 332 334 336 337 338
## [121] 339 340 345 349 354 373 380 381 383 386 404 406
## [133] 413 414 423 426 432 434 458 460 484 491 492 494
## [145] 497 507 520 521 522 523 524 609 612 631 659 3819
## [157] 3820 3821 3822 3823 3824 3826 3827 3828 3829 3830 3831 3832
## [169] 3833 3834 3835 3836 3837 3839 3840 3842 3843 3844 3845 3846
## [181] 3847 3848 3849 3851 3852 3853 3854 3855 3856 3857 3858 3859
## [193] 3860 6139 6140 11193 11206 11209 11212 11215 11216 11221 11222 11223
## [205] 11225 11227 11232 11233 11234 11238 11239 11241 11242 11244 11246 11250
## [217] 11253 11255 11256 11257 11266 11267 11269 11270 11272 11274 11278 11280
## [229] 11281 11284 11288 11297 11300 11302 11308 11310 11312 11313 11314 11317
## [241] 11319 11321 11322 11324 11328 11329 11331 11333 11341 11344 11346 11349
## [253] 11352 11355 11356 11358 11364 11379 11384 11390 11399 11410 11411 11418
## [265] 11423 11431 11433 11435 11442 11446 11447 11450 11452 11454 11458 11459
## [277] 11468 11472 11474 11480 11487 11491 11497 11498 11499 11504 11507 11514
## [289] 11520 11523 11526 11532 11537 11540 11544 11548 11555 11567 11569 11570
## [301] 11573 11584 11600 11615 11618 11623 11625 11626 11627 11629 11635 11636
## [313] 11637 11639 11641 11642 11656 11659 11666 11668 11671 11685 11686 11689
## [325] 11690 11694 11699 11700 11705 11711 11712 11715 11716 11724 11736 11737
## [337] 11744 11750 11766 11769 11770 11773 11774 11781 11783 11803 11804 11806
## [349] 11815 11823 11827 11831 11833 11846 11851 11853 11857 11860 11871 11873
## [361] 11877 11880 11887 11888 11897 11905 11912 11919 11929 11935 11948 11951
## [373] 11953 11958 11966 11969 11972 11975 11993 12003 12007 12009 12018 12019
## [385] 12021 12023 12024 12029 12033 12034 12045 12049 12051 12056 12057 12069
## [397] 12084 12085 12086 12089 12090 12093 12094 12096 12100 12103 12105 12107
## [409] 12118 12124 12134 12141 12145 12151 12162 12164 12169 12170 12173 12174
## [421] 12175 12183 12184 12190 12209 12217 12241 12246 12252 12262 12263 12264
## [433] 12269 12270 12271 12276 12283 12284 12286 12288 12289 12297 12299 12307
## [445] 12314 12315 12316 12319 12324 12325 12329 12345 12348 12351 12353 12357
## [457] 12371 12373 12387 12390 12394 12400 12401 12422 12424 12434 12437 12441
## [469] 12459 12462 12463 12478 12483 12491 12508 12521 12539 12544 12546 12550
## [481] 12553 12562 12566 12571 12572 12584 12586 12591 12592 12596 12597 12599
## [493] 12601 12606 12626 12629 12641 12645 12653 12654 12657 12668 12670 12672
## [505] 12673 12674 12684 12699 12711 12714 12720 12723
# There are just above 500 outliers in the Current Admission Date variable because it is skewed left. These outliers would be the people who have been in prison the longest.
#Plot
stripchart(FinalProjectData[,10], method = "stack")
#Mean
mean_court_admin <- mean(FinalProjectData[,11])
mean_court_admin
## [1] 0.8648163
#Standard Deviation
sd_court_admin <- sd(FinalProjectData[,11])
sd_court_admin
## [1] 0.3419258
#Sample Variance
var_court_admin <- var(FinalProjectData[,11])
var_court_admin
## [1] 0.1169132
#Skewness
skew_court_admin <- skewness(FinalProjectData[,11])
skew_court_admin
## [1] -2.13393
#Kurtosis
kurt_court_admin <- kurtosis(FinalProjectData[,11])
kurt_court_admin
## [1] 5.553659
#1D Outliers
which(abs(scale(FinalProjectData[,11]))>3)
## integer(0)
#Plot
stripchart(FinalProjectData[,11], method = "stack")
#Mean
mean_new_sent <- mean(FinalProjectData[,12])
mean_new_sent
## [1] 0.0529604
#Standard Deviation
sd_new_sent <- sd(FinalProjectData[,12])
sd_new_sent
## [1] 0.2239585
#Sample Variance
var_new_sent <- var(FinalProjectData[,12])
var_new_sent
## [1] 0.05015739
#Skewness
skew_new_sent <- skewness(FinalProjectData[,12])
skew_new_sent
## [1] 3.992237
#Kurtosis
kurt_new_sent <- kurtosis(FinalProjectData[,12])
kurt_new_sent
## [1] 16.93796
#1D Outliers
which(abs(scale(FinalProjectData[,12]))>3)
## [1] 2 4 7 8 9 13 14 22 23 24 31 33
## [13] 35 38 39 40 42 46 49 51 53 56 58 63
## [25] 64 65 67 68 73 75 79 80 83 85 89 90
## [37] 99 105 109 114 115 116 117 122 128 129 135 140
## [49] 152 154 155 160 163 167 170 172 179 181 183 188
## [61] 193 197 200 201 206 214 216 218 219 229 240 248
## [73] 252 256 260 263 273 274 278 279 280 284 285 300
## [85] 305 331 335 337 339 340 345 349 354 359 361 362
## [97] 364 374 377 388 389 393 407 420 422 447 449 452
## [109] 480 504 505 508 512 515 549 566 570 624 628 640
## [121] 656 668 680 683 689 693 709 723 729 732 755 785
## [133] 791 792 793 805 815 840 849 850 851 859 876 889
## [145] 919 933 987 999 1014 1040 1041 1054 1056 1083 1084 1090
## [157] 1148 1163 1169 1179 1186 1192 1206 1207 1243 1274 1286 1290
## [169] 1295 1305 1327 1329 1337 1339 1342 1347 1348 1354 1365 1369
## [181] 1371 1386 1396 1412 1468 1488 1505 1525 1526 1538 1543 1549
## [193] 1560 1562 1564 1616 1635 1661 1669 1679 1681 1683 1704 1762
## [205] 1766 1769 1785 1795 1832 1835 1836 1840 1856 1859 1864 1904
## [217] 1937 1942 1959 1966 1976 1983 1992 2006 2014 2024 2028 2040
## [229] 2046 2051 2058 2076 2085 2095 2098 2099 2124 2157 2166 2182
## [241] 2202 2209 2212 2240 2251 2253 2256 2269 2276 2277 2280 2302
## [253] 2306 2308 2325 2341 2344 2362 2376 2394 2410 2416 2451 2468
## [265] 2473 2485 2494 2510 2524 2530 2551 2570 2580 2597 2600 2601
## [277] 2610 2633 2634 2635 2652 2695 2696 2733 2751 2762 2764 2800
## [289] 2870 2904 2935 2951 2971 2990 3008 3009 3019 3024 3030 3049
## [301] 3050 3058 3068 3072 3087 3094 3176 3183 3191 3195 3246 3255
## [313] 3259 3271 3294 3295 3296 3298 3326 3361 3377 3382 3397 3417
## [325] 3421 3429 3437 3444 3454 3461 3470 3478 3514 3555 3557 3580
## [337] 3585 3604 3607 3610 3625 3641 3645 3660 3672 3711 3736 3746
## [349] 3754 3782 3795 3800 3815 3835 3836 3840 3845 3876 3877 3878
## [361] 3888 3899 3900 3910 3928 3931 3937 3951 3952 3962 3972 3983
## [373] 3985 3986 3996 4001 4014 4029 4033 4038 4069 4075 4086 4089
## [385] 4116 4134 4139 4141 4142 4166 4168 4194 4210 4229 4244 4274
## [397] 4275 4283 4320 4324 4332 4339 4358 4381 4438 4441 4505 4509
## [409] 4535 4613 4677 4685 4693 4701 4738 4739 4740 4747 4753 4761
## [421] 4771 4800 4816 4820 4839 4845 4869 4872 4882 4891 4927 4948
## [433] 4954 4961 4967 4968 4975 4992 5000 5007 5016 5018 5029 5042
## [445] 5058 5061 5073 5093 5106 5172 5173 5183 5189 5195 5201 5202
## [457] 5221 5256 5289 5379 5390 5391 5413 5454 5468 5471 5539 5560
## [469] 5572 5587 5600 5631 5642 5647 5649 5657 5692 5707 5708 5709
## [481] 5726 5744 5745 5773 5777 5785 5786 5796 5801 5813 5889 5891
## [493] 5924 5929 5971 5983 5985 6001 6009 6018 6019 6024 6025 6044
## [505] 6064 6073 6084 6088 6094 6104 6111 6114 6121 6122 6128 6144
## [517] 6160 6167 6171 6181 6189 6254 6277 6302 6304 6311 6317 6379
## [529] 6389 6404 6430 6456 6467 6474 6491 6494 6528 6561 6624 6647
## [541] 6669 6687 6706 6725 6737 6738 6752 6815 6823 6825 6828 6834
## [553] 6850 6889 6913 6915 6923 6926 6979 7006 7029 7030 7046 7058
## [565] 7096 7113 7118 7136 7137 7144 7145 7192 7196 7199 7205 7273
## [577] 7305 7338 7383 7448 7467 7484 7500 7514 7548 7589 7596 7602
## [589] 7640 7687 7707 7720 7755 7761 7780 7785 7789 7801 7803 7812
## [601] 7825 7857 7867 7902 7964 7972 7984 8016 8050 8063 8067 8114
## [613] 8219 8236 8290 8295 8315 8340 8389 8466 8502 8503 8554 8568
## [625] 8589 8590 8598 8603 8605 8635 8660 8677 8678 8711 8720 8749
## [637] 8763 8809 8823 8833 8875 8877 8933 8934 8954 8967 8968 8991
## [649] 8996 9009 9022 9027 9072 9081 9120 9127 9129 9130 9148 9211
## [661] 9215 9276 9295 9329 9363 9369 9373 9387 9401 9418 9429 9440
## [673] 9441 9447 9453 9460 9472 9521 9533 9546 9607 9726 9736 9753
## [685] 9838 9874 9892 9908 9909 9975 10039 10071 10127 10186 10187 10221
## [697] 10222 10224 10231 10235 10296 10323 10358 10395 10431 10434 10512 10527
## [709] 10541 10548 10605 10636 10647 10657 10665 10676 10682 10702 10709 10725
## [721] 10756 10764 10851 10869 10899 10911 10992 11031 11032 11045 11093 11115
## [733] 11121 11139 11157 11175 11207 11215 11220 11221 11224 11226 11237 11242
## [745] 11243 11252 11257 11260 11265 11281 11296 11299 11300 11301 11317 11320
## [757] 11322 11324 11328 11333 11349 11354 11358 11360 11377 11384 11392 11412
## [769] 11424 11441 11442 11445 11474 11481 11482 11486 11491 11497 11509 11520
## [781] 11529 11535 11548 11572 11583 11584 11588 11598 11603 11607 11611 11613
## [793] 11620 11621 11622 11627 11631 11634 11650 11659 11667 11671 11673 11674
## [805] 11676 11678 11686 11690 11692 11698 11700 11703 11715 11716 11721 11725
## [817] 11730 11732 11751 11752 11760 11763 11778 11783 11800 11805 11838 11840
## [829] 11868 11870 11874 11879 11892 11897 11911 11915 11920 11928 11936 11953
## [841] 11960 11985 11992 11995 12000 12015 12036 12055 12058 12098 12108 12137
## [853] 12138 12139 12152 12163 12193 12215 12216 12220 12234 12236 12249 12253
## [865] 12279 12292 12298 12306 12310 12312 12318 12321 12340 12361 12370 12377
## [877] 12397 12404 12405 12425 12440 12447 12451 12453 12469 12488 12490 12510
## [889] 12529 12537 12567 12578 12583 12602 12607 12615 12627 12635 12638 12644
## [901] 12656 12665 12678 12679 12683 12693 12706 12715 12717 12726 12730 12763
## [913] 12818 12865 12866 12895 12901 12908 12925 12989 12990 12998 13014 13058
## [925] 13080 13098 13124 13160 13169 13207 13209 13217 13278 13311 13332 13338
## [937] 13370 13371 13374 13376 13453 13456 13465 13468 13474 13484 13505 13546
## [949] 13565 13589 13659 13717 13752 13815 13826 13856 13872 13874 13913 13928
## [961] 13938 13948 13962 13963 14011 14021 14037 14108 14110 14112 14135 14160
## [973] 14165 14175 14198 14208 14236 14241 14248 14251 14318 14364 14365 14386
## [985] 14408 14426 14431 14460 14486 14519 14592 14603 14615 14625 14636 14664
## [997] 14707 14751 14800 14805 14810 14841 14877 14881 15002 15069 15072 15132
## [1009] 15144 15192 15220 15246 15249 15251 15292 15299 15318 15327 15346 15347
## [1021] 15362 15385 15386 15391 15402 15457 15458 15480 15481 15489 15491 15492
## [1033] 15547 15601 15612 15631 15645 15681 15711 15742 15762 15765 15806 15808
## [1045] 15829 15832 15833 15861 15874 15889 15911 15953 16012 16050 16073 16075
## [1057] 16077 16107 16123 16134 16143 16152 16160 16173 16196 16210 16211 16249
## [1069] 16281 16288 16292 16344 16390 16402 16425 16460 16495 16498 16516 16538
## [1081] 16552 16577 16591 16606 16618 16662 16666 16680 16695 16711 16728 16734
## [1093] 16759 16768 16833 16834 16839 16860 16867 16882 16887 16894 16899 16966
## [1105] 16994 17011 17031 17040 17042 17120 17122 17201 17202 17267 17310 17355
## [1117] 17399 17484 17508 17529 17534 17545 17549 17559 17569 17573 17584 17607
## [1129] 17618 17627 17681 17700 17702 17711 17730 17744 17750 17773 17799 17809
## [1141] 17814 17816 17828 17851 17918 17941 17948 17961 17966 17967 17972 17975
## [1153] 17988 18002 18027 18038 18042 18046 18056 18062 18074 18085 18091 18097
## [1165] 18112 18126 18141 18147 18158 18164 18180 18184 18196 18211 18214 18230
## [1177] 18249 18250 18253 18261 18275 18283 18309 18342 18349 18368 18371 18372
## [1189] 18378 18386 18391 18395 18419 18425 18444 18462 18477 18479 18482 18485
## [1201] 18486 18496 18503 18510 18541 18570 18577 18581 18586 18594 18601 18603
## [1213] 18629 18673 18688 18693 18698 18713 18720 18727 18730 18742 18745 18756
## [1225] 18765 18768 18785 18792 18794 18807 18861 18862 18876 18888 18914 18924
## [1237] 18932 18944 18959 18974 19008 19015 19033 19072 19120 19189 19215 19253
## [1249] 19278 19290 19353 19373 19375 19379 19421 19444 19459 19467 19474 19522
## [1261] 19525 19534 19546 19569 19572 19575 19602 19629 19646 19662 19728 19730
## [1273] 19794 19920 19926 19935 19936 19942 19956 19970 19981 20060 20082 20105
## [1285] 20119 20177 20183 20195 20200 20251 20252 20292 20304 20324 20346 20360
## [1297] 20361 20362 20363 20404 20411 20419 20426 20428 20499 20501 20504 20539
## [1309] 20567 20574 20603 20608 20633 20663 20690 20703 20706 20714 20716 20739
## [1321] 20744 20783 20786 20793 20801 20803 20806 20841 20866 20878 20907 20921
## [1333] 20949 20962 20980 21011 21019 21123 21157 21161 21177 21192 21193 21207
## [1345] 21221 21240 21243 21296 21319 21344 21356 21363 21366 21369 21392 21447
## [1357] 21452 21519 21528 21534 21556 21570 21586 21600 21623 21636 21646 21653
## [1369] 21701 21720 21723 21724 21730 21747 21748 21783 21818 21832 21852 21869
## [1381] 21871 21888 21957 21963 21974 21975 21977 21982 21983 21985 21986 21989
## [1393] 22010 22012 22066 22099 22127 22162 22193 22221 22238 22279 22303 22321
## [1405] 22326 22349 22382 22422 22469 22470 22486 22522 22550 22564 22572 22574
## [1417] 22602 22613 22636 22656 22677 22698 22736 22773 22808 22895 23020 23125
## [1429] 23176 23177 23227 23240 23266 23272 23322 23362 23364 23435 23453 23456
## [1441] 23461 23472 23500 23505 23511 23518 23548 23724 23736 23752 23771 23784
## [1453] 23791 23794 23917 23933 23952 23992 24091 24111 24120 24156 24165 24175
## [1465] 24218 24255 24308 24333 24346 24414 24492 24557 24562 24715 24891
# All 1475 new sentence violators are considered outliers because there are so few of them.
#Plot
stripchart(FinalProjectData[,12], method = "stack")
#Mean
mean_tech_viol <- mean(FinalProjectData[,13])
mean_tech_viol
## [1] 0.07834548
#Standard Deviation
sd_tech_viol <- sd(FinalProjectData[,13])
sd_tech_viol
## [1] 0.2687193
#Sample Variance
var_tech_viol <- var(FinalProjectData[,13])
var_tech_viol
## [1] 0.07221006
#Skewness
skew_tech_viol <- skewness(FinalProjectData[,13])
skew_tech_viol
## [1] 3.138309
#Kurtosis
kurt_tech_viol <- kurtosis(FinalProjectData[,13])
kurt_tech_viol
## [1] 10.84898
#1D Outliers
which(abs(scale(FinalProjectData[,13]))>3)
## [1] 52 69 103 113 125 131 178 184 186 194 213 227
## [13] 230 238 249 272 301 306 321 322 346 355 381 382
## [25] 383 384 415 435 438 451 463 468 472 477 478 501
## [37] 564 571 580 657 665 679 685 695 711 738 740 750
## [49] 767 769 806 807 809 819 822 826 833 846 852 855
## [61] 872 880 887 894 897 917 932 942 954 959 980 990
## [73] 994 1011 1018 1019 1022 1024 1037 1062 1063 1064 1075 1077
## [85] 1096 1126 1129 1140 1151 1156 1177 1178 1182 1183 1188 1189
## [97] 1191 1220 1249 1257 1278 1292 1300 1307 1308 1315 1326 1328
## [109] 1332 1333 1344 1352 1355 1366 1372 1374 1385 1392 1406 1408
## [121] 1436 1445 1451 1467 1477 1478 1483 1484 1487 1501 1524 1550
## [133] 1555 1592 1607 1630 1640 1642 1654 1680 1763 1764 1825 1828
## [145] 1829 1833 1838 1847 1857 1880 1896 1910 1931 1977 1989 1996
## [157] 2053 2062 2075 2090 2138 2156 2168 2178 2185 2211 2217 2230
## [169] 2282 2289 2312 2336 2354 2369 2383 2412 2428 2436 2446 2456
## [181] 2462 2472 2518 2519 2534 2539 2558 2576 2581 2585 2592 2607
## [193] 2612 2627 2631 2647 2656 2680 2688 2693 2705 2720 2742 2757
## [205] 2788 2790 2806 2824 2825 2826 2846 2853 2865 2879 2884 2918
## [217] 2934 2944 2986 3004 3017 3028 3047 3079 3086 3101 3112 3120
## [229] 3128 3134 3144 3152 3153 3160 3162 3171 3172 3173 3198 3214
## [241] 3222 3239 3243 3245 3249 3250 3263 3317 3332 3363 3366 3376
## [253] 3380 3383 3384 3385 3392 3403 3406 3408 3431 3433 3435 3442
## [265] 3451 3457 3458 3462 3475 3491 3496 3522 3529 3536 3550 3551
## [277] 3564 3575 3581 3637 3654 3666 3668 3671 3681 3682 3720 3731
## [289] 3735 3743 3753 3763 3765 3766 3784 3792 3793 3796 3818 3825
## [301] 3838 3841 3850 3890 3898 3924 3927 3959 3997 4013 4032 4045
## [313] 4047 4052 4084 4107 4127 4132 4137 4179 4189 4234 4237 4239
## [325] 4243 4246 4281 4317 4322 4330 4364 4375 4384 4385 4401 4423
## [337] 4430 4450 4481 4487 4519 4536 4537 4559 4561 4590 4591 4592
## [349] 4598 4607 4609 4616 4634 4654 4655 4684 4702 4711 4712 4719
## [361] 4749 4750 4764 4765 4767 4830 4860 4877 4957 4972 4982 5019
## [373] 5020 5027 5033 5044 5065 5104 5116 5161 5168 5181 5204 5211
## [385] 5225 5226 5229 5258 5271 5283 5300 5304 5319 5329 5350 5354
## [397] 5359 5362 5364 5371 5382 5383 5386 5403 5419 5425 5438 5464
## [409] 5512 5514 5519 5542 5585 5596 5602 5629 5637 5695 5727 5735
## [421] 5763 5779 5797 5811 5820 5832 5833 5862 5895 5896 5900 5911
## [433] 5915 5919 5921 5923 5928 5936 5944 5958 5972 5995 6011 6029
## [445] 6040 6047 6083 6095 6098 6125 6127 6129 6133 6159 6164 6173
## [457] 6175 6179 6183 6184 6188 6193 6198 6200 6212 6233 6238 6248
## [469] 6249 6251 6252 6259 6265 6269 6281 6288 6309 6328 6334 6348
## [481] 6351 6354 6359 6384 6386 6392 6397 6398 6436 6440 6469 6472
## [493] 6473 6477 6484 6504 6507 6521 6526 6535 6538 6551 6552 6565
## [505] 6577 6592 6600 6602 6628 6633 6646 6653 6674 6733 6734 6735
## [517] 6740 6741 6742 6759 6761 6768 6776 6795 6804 6835 6839 6841
## [529] 6853 6856 6859 6866 6869 6870 6875 6878 6914 6918 6933 6938
## [541] 6940 6957 6992 7012 7021 7033 7035 7051 7071 7085 7095 7108
## [553] 7122 7127 7130 7140 7201 7216 7220 7228 7238 7249 7257 7268
## [565] 7269 7274 7277 7286 7325 7347 7353 7380 7384 7398 7399 7407
## [577] 7427 7436 7439 7466 7502 7518 7520 7529 7537 7541 7546 7555
## [589] 7557 7572 7574 7581 7590 7619 7638 7646 7654 7667 7686 7704
## [601] 7706 7711 7712 7723 7739 7753 7754 7764 7766 7800 7804 7807
## [613] 7820 7829 7845 7882 7908 7917 7918 7936 7959 7961 7965 7989
## [625] 8026 8027 8061 8062 8066 8081 8083 8086 8098 8102 8107 8129
## [637] 8135 8139 8141 8163 8167 8169 8186 8189 8217 8226 8245 8256
## [649] 8264 8267 8273 8293 8317 8322 8336 8337 8343 8359 8368 8406
## [661] 8413 8435 8436 8494 8496 8497 8498 8506 8508 8517 8520 8525
## [673] 8535 8550 8561 8578 8585 8596 8597 8602 8620 8633 8663 8673
## [685] 8691 8696 8707 8717 8733 8746 8748 8765 8768 8770 8786 8795
## [697] 8797 8814 8829 8849 8856 8872 8882 8905 8929 8938 8939 8946
## [709] 8949 8950 8955 8961 8975 8976 8977 8981 9003 9043 9046 9047
## [721] 9056 9063 9068 9078 9102 9108 9117 9135 9166 9169 9182 9186
## [733] 9197 9200 9208 9214 9219 9226 9235 9266 9275 9281 9284 9289
## [745] 9291 9301 9312 9320 9331 9332 9340 9351 9378 9386 9396 9436
## [757] 9477 9486 9493 9507 9536 9542 9567 9574 9583 9584 9590 9601
## [769] 9604 9630 9644 9655 9657 9685 9706 9725 9760 9768 9769 9790
## [781] 9802 9806 9820 9839 9840 9852 9864 9872 9873 9884 9906 9913
## [793] 9920 9923 9932 9935 9936 9951 9964 9974 9979 9985 9988 10015
## [805] 10027 10036 10044 10050 10051 10074 10078 10101 10103 10134 10144 10150
## [817] 10156 10157 10160 10170 10178 10229 10236 10237 10240 10243 10252 10272
## [829] 10282 10283 10308 10333 10338 10349 10363 10385 10387 10403 10415 10422
## [841] 10429 10435 10443 10445 10474 10478 10485 10515 10531 10533 10544 10553
## [853] 10555 10558 10564 10577 10579 10580 10590 10608 10629 10654 10660 10684
## [865] 10691 10694 10705 10777 10818 10834 10855 10864 10870 10874 10886 10896
## [877] 10941 10974 10997 10998 11013 11035 11048 11050 11068 11072 11083 11085
## [889] 11086 11099 11107 11108 11117 11127 11134 11140 11150 11155 11160 11166
## [901] 11173 11178 11185 11187 11246 11294 11311 11321 11325 11326 11400 11405
## [913] 11407 11415 11417 11430 11438 11440 11462 11470 11488 11512 11544 11551
## [925] 11565 11566 11578 11589 11593 11605 11616 11617 11629 11633 11653 11683
## [937] 11688 11707 11723 11727 11747 11768 11792 11812 11834 11839 11842 11849
## [949] 11867 11893 11923 11926 11934 11940 11943 11946 11959 11962 11974 11983
## [961] 11989 11997 12008 12012 12027 12062 12064 12072 12082 12100 12131 12136
## [973] 12166 12172 12201 12202 12222 12232 12287 12308 12322 12323 12347 12362
## [985] 12363 12378 12410 12419 12420 12439 12475 12480 12493 12498 12502 12523
## [997] 12549 12557 12568 12589 12624 12660 12661 12690 12696 12701 12708 12712
## [1009] 12718 12721 12738 12761 12807 12816 12824 12827 12846 12875 12885 12904
## [1021] 12907 12911 12939 12959 12960 12962 12963 12966 12994 13008 13019 13037
## [1033] 13038 13048 13066 13117 13122 13141 13143 13155 13157 13174 13199 13225
## [1045] 13237 13244 13307 13319 13337 13341 13373 13377 13389 13396 13409 13424
## [1057] 13425 13438 13461 13464 13480 13501 13516 13580 13583 13584 13593 13594
## [1069] 13605 13617 13678 13682 13704 13711 13715 13722 13725 13726 13742 13760
## [1081] 13765 13777 13779 13787 13791 13795 13797 13824 13837 13845 13847 13851
## [1093] 13868 13873 13881 13893 13943 13950 13956 13978 13984 14018 14023 14032
## [1105] 14039 14052 14064 14111 14125 14131 14162 14164 14179 14199 14229 14240
## [1117] 14244 14273 14274 14280 14285 14288 14298 14319 14331 14336 14339 14383
## [1129] 14385 14399 14412 14421 14428 14437 14470 14475 14515 14518 14532 14537
## [1141] 14549 14554 14556 14584 14589 14599 14630 14634 14638 14649 14671 14681
## [1153] 14697 14700 14705 14749 14782 14792 14817 14847 14879 14900 14935 14945
## [1165] 14946 14953 14967 15003 15007 15011 15030 15047 15073 15081 15093 15097
## [1177] 15101 15121 15131 15142 15176 15186 15202 15203 15214 15239 15244 15252
## [1189] 15267 15276 15283 15298 15329 15335 15348 15373 15400 15420 15422 15424
## [1201] 15428 15444 15487 15498 15517 15535 15537 15559 15579 15583 15622 15630
## [1213] 15642 15664 15669 15686 15689 15697 15709 15715 15719 15730 15758 15770
## [1225] 15783 15793 15794 15798 15824 15826 15837 15840 15855 15873 15888 15894
## [1237] 15896 15898 15899 15900 15904 15909 15921 15925 15940 15981 15985 15986
## [1249] 15988 15990 15993 16005 16013 16019 16033 16060 16068 16072 16087 16099
## [1261] 16119 16125 16127 16149 16153 16156 16170 16179 16205 16216 16235 16261
## [1273] 16263 16266 16267 16272 16293 16312 16320 16330 16333 16356 16359 16372
## [1285] 16379 16380 16381 16389 16410 16420 16437 16475 16477 16481 16485 16500
## [1297] 16507 16511 16523 16525 16536 16559 16574 16609 16625 16626 16636 16649
## [1309] 16651 16659 16681 16687 16704 16735 16737 16741 16752 16754 16783 16797
## [1321] 16842 16850 16852 16853 16879 16883 16897 16900 16902 16911 16914 16921
## [1333] 16930 16944 16950 16951 16979 16980 16989 17002 17012 17020 17024 17028
## [1345] 17036 17045 17101 17125 17130 17142 17177 17211 17223 17297 17363 17381
## [1357] 17410 17415 17420 17430 17448 17455 17456 17458 17459 17466 17467 17481
## [1369] 17490 17506 17507 17516 17523 17539 17546 17567 17583 17603 17613 17615
## [1381] 17622 17630 17654 17662 17663 17667 17687 17696 17705 17719 17720 17725
## [1393] 17749 17765 17777 17782 17790 17794 17798 17804 17843 17880 17883 17884
## [1405] 17891 17894 17895 17896 17900 17902 17903 17909 17911 17930 17932 17933
## [1417] 17938 17964 17970 17974 17978 17983 18018 18037 18054 18057 18068 18072
## [1429] 18077 18086 18105 18123 18138 18146 18148 18153 18163 18198 18204 18210
## [1441] 18216 18263 18269 18276 18277 18279 18288 18297 18299 18304 18310 18316
## [1453] 18320 18321 18339 18345 18351 18367 18369 18390 18405 18416 18418 18426
## [1465] 18429 18431 18436 18439 18446 18460 18465 18468 18495 18511 18513 18515
## [1477] 18520 18543 18559 18560 18578 18579 18585 18598 18611 18615 18642 18647
## [1489] 18648 18668 18675 18677 18692 18703 18706 18714 18750 18757 18760 18777
## [1501] 18783 18784 18786 18790 18799 18816 18833 18847 18860 18875 18889 18895
## [1513] 18910 18915 18935 18936 18940 18943 18958 18994 18995 19005 19055 19063
## [1525] 19067 19084 19095 19105 19107 19117 19119 19125 19131 19139 19162 19165
## [1537] 19178 19185 19191 19196 19200 19204 19205 19234 19240 19247 19266 19271
## [1549] 19291 19294 19303 19315 19326 19336 19338 19349 19381 19382 19385 19406
## [1561] 19415 19416 19428 19431 19445 19448 19461 19480 19505 19510 19548 19591
## [1573] 19597 19603 19633 19637 19644 19656 19669 19674 19700 19720 19733 19737
## [1585] 19743 19756 19760 19781 19786 19793 19795 19805 19813 19823 19824 19855
## [1597] 19861 19863 19882 19905 19927 19937 19944 19946 19954 19999 20016 20027
## [1609] 20031 20036 20050 20061 20062 20070 20083 20087 20099 20132 20150 20153
## [1621] 20154 20165 20167 20170 20187 20189 20223 20235 20265 20286 20313 20317
## [1633] 20319 20337 20345 20369 20392 20399 20402 20405 20409 20425 20441 20442
## [1645] 20462 20464 20466 20469 20484 20502 20544 20594 20602 20610 20612 20618
## [1657] 20619 20623 20642 20647 20654 20669 20670 20679 20683 20698 20700 20726
## [1669] 20734 20740 20743 20747 20750 20764 20795 20810 20815 20844 20848 20858
## [1681] 20883 20886 20898 20908 20912 20928 20940 20965 20981 20989 21002 21006
## [1693] 21013 21015 21060 21089 21101 21102 21104 21112 21115 21116 21119 21125
## [1705] 21129 21138 21147 21156 21171 21173 21181 21209 21218 21232 21267 21275
## [1717] 21278 21281 21300 21301 21317 21326 21368 21373 21375 21417 21431 21453
## [1729] 21475 21478 21497 21527 21530 21535 21538 21551 21553 21562 21572 21578
## [1741] 21581 21584 21598 21602 21606 21631 21642 21651 21652 21661 21671 21679
## [1753] 21732 21750 21762 21797 21801 21810 21813 21835 21843 21847 21848 21859
## [1765] 21861 21887 21902 21910 21921 21929 21932 21934 22003 22009 22016 22019
## [1777] 22043 22045 22048 22052 22068 22084 22112 22114 22118 22132 22136 22158
## [1789] 22165 22184 22186 22190 22192 22215 22220 22236 22248 22254 22282 22287
## [1801] 22291 22300 22307 22313 22315 22324 22335 22341 22353 22362 22383 22387
## [1813] 22388 22391 22405 22414 22421 22427 22433 22452 22456 22459 22476 22484
## [1825] 22507 22517 22518 22519 22521 22523 22528 22538 22552 22559 22578 22582
## [1837] 22589 22590 22593 22594 22597 22604 22611 22612 22649 22652 22661 22671
## [1849] 22700 22705 22712 22721 22733 22734 22754 22775 22779 22782 22787 22790
## [1861] 22831 22839 22841 22842 22845 22848 22854 22861 22864 22878 22888 22890
## [1873] 22892 22909 22910 22911 22918 22920 22923 22925 22926 22935 22940 22946
## [1885] 22973 22983 22985 22997 23050 23051 23061 23066 23069 23092 23108 23112
## [1897] 23120 23127 23137 23141 23142 23145 23150 23151 23169 23187 23188 23199
## [1909] 23208 23217 23224 23226 23246 23247 23259 23273 23276 23285 23297 23306
## [1921] 23311 23321 23326 23336 23345 23348 23351 23354 23365 23370 23373 23397
## [1933] 23421 23425 23438 23439 23440 23446 23451 23458 23477 23485 23492 23510
## [1945] 23513 23514 23522 23526 23528 23545 23555 23559 23565 23573 23587 23599
## [1957] 23611 23613 23620 23629 23639 23640 23641 23642 23649 23650 23690 23703
## [1969] 23709 23726 23727 23728 23733 23741 23742 23766 23768 23770 23775 23786
## [1981] 23807 23831 23838 23843 23848 23854 23855 23869 23870 23875 23890 23892
## [1993] 23894 23944 23953 23955 23963 23973 23977 23978 23990 23991 23993 24006
## [2005] 24007 24014 24039 24040 24046 24063 24066 24069 24076 24081 24082 24086
## [2017] 24113 24118 24123 24133 24153 24158 24162 24183 24186 24189 24194 24213
## [2029] 24217 24226 24230 24234 24240 24244 24247 24248 24251 24263 24292 24304
## [2041] 24315 24347 24351 24355 24356 24358 24359 24360 24363 24374 24379 24384
## [2053] 24397 24410 24419 24446 24468 24493 24494 24497 24501 24503 24548 24573
## [2065] 24580 24592 24595 24607 24612 24625 24649 24654 24691 24703 24721 24723
## [2077] 24734 24773 24785 24786 24796 24817 24837 24851 24856 24860 24866 24869
## [2089] 24875 24882 24886 24895 24907 24924 24937 24986 25093 25098 25111 25124
## [2101] 25132 25144 25176 25190 25210 25221 25233 25234 25238 25250 25252 25255
## [2113] 25261 25278 25279 25296 25307 25320 25321 25340 25375 25378 25408 25452
## [2125] 25453 25455 25507 25517 25537 25566 25574 25575 25619 25628 25629 25655
## [2137] 25726 25736 25766 25774 25785 25804 25818 25881 25945 25967 26015 26037
## [2149] 26044 26048 26073 26079 26086 26169 26191 26203 26256 26290 26361 26398
## [2161] 26433 26447 26461 26470 26538 26635 26733 26747 26809 26886 26953 27065
## [2173] 27086 27143 27174 27394 27492 27520 27606 27707 27717 27770
# All 2182 technical violators are considered outliers because there are so few of them.
#Plot
stripchart(FinalProjectData[,13], method = "stack")
#Mean
meanprojmsrdate <- mean(FinalProjectData[,14], na.rm = TRUE)
meanprojmsrdate
## [1] 47218.68
#Standard Deviation
sdprojmsrdate <- sd(FinalProjectData[,14], na.rm = TRUE)
sdprojmsrdate
## [1] 4100.456
#Sample Variance
varprojmsrdate <- var(FinalProjectData[,14], na.rm = TRUE)
varprojmsrdate
## [1] 16813744
#Skewness
skewprojmsrdate <- skewness(FinalProjectData[,14], na.rm = TRUE)
skewprojmsrdate
## [1] 2.132513
#Kurtosis
kurtprojmsrdate <- kurtosis(FinalProjectData[,14], na.rm = TRUE)
kurtprojmsrdate
## [1] 7.404976
#1D Outliers
which(abs(scale(FinalProjectData[,14]))>3)
## [1] 2 123 137 219 450 456 486 639 903 957 1016 1085
## [13] 1095 1146 1363 1468 1478 1507 1543 1558 1594 1606 1674 1678
## [25] 1774 1793 1808 1834 1862 1911 1915 1946 1952 1974 2026 2076
## [37] 2091 2131 2149 2192 2207 2232 2238 2240 2251 2274 2316 2333
## [49] 2351 2360 2365 2414 2418 2460 2480 2494 2599 2645 2662 2664
## [61] 2672 2725 2734 2737 2752 2769 2771 2812 2850 2870 2885 2887
## [73] 2894 2913 2917 2929 3022 3151 3161 3175 3185 3268 3291 3359
## [85] 3372 3402 3569 3580 3588 3606 3663 3673 3674 3701 3771 3803
## [97] 3809 3828 3831 3834 3842 3844 3845 3847 3849 3854 3856 3858
## [109] 3859 3889 3926 3943 3961 4010 4029 4064 4079 4114 4140 4226
## [121] 4274 4284 4293 4359 4382 4395 4396 4415 4419 4451 4453 4478
## [133] 4544 4573 4594 4676 4709 4724 4761 4782 4875 4879 4958 5018
## [145] 5051 5075 5105 5118 5120 5150 5165 5183 5217 5223 5238 5263
## [157] 5284 5358 5379 5399 5463 5499 5529 5550 5587 5633 5697 5742
## [169] 5778 5780 5813 5819 5834 5907 5948 6018 6192 6208 6230 6240
## [181] 6245 6262 6268 6316 6341 6349 6382 6383 6396 6422 6475 6482
## [193] 6492 6500 6586 6587 6598 6627 6658 6667 6671 6679 6689 6747
## [205] 6815 6887 6973 7029 7057 7075 7190 7209 7215 7219 7239 7278
## [217] 7357 7414 7458 7485 7494 7505 7525 7552 7637 7662 7672 7679
## [229] 7694 7730 7741 7748 7761 7799 7847 7852 7855 7906 7950 8022
## [241] 8057 8058 8071 8080 8089 8249 8301 8312 8320 8347 8367 8371
## [253] 8379 8405 8419 8571 8637 8651 8657 8812 8834 8865 8876 8892
## [265] 8965 8969 8983 9040 9048 9073 9150 9156 9258 9274 9285 9307
## [277] 9309 9323 9379 9413 9414 9503 9522 9557 9559 9575 9616 9637
## [289] 9643 9646 9652 9673 9679 9738 9773 9784 9813 9821 9837 9882
## [301] 9901 9905 9926 9959 9987 10084 10106 10116 10121 10155 10192 10246
## [313] 10297 10344 10402 10421 10462 10474 10492 10493 10535 10538 10556 10560
## [325] 10573 10588 10599 10671 10685 10720 10744 10769 10839 10867 10868 10884
## [337] 10922 10939 10946 10984 11026 11161 11176 11224 11296 11298 11339 11345
## [349] 11413 11449 11562 11706 11748 11764 11775 11843 11882 11939 12068 12099
## [361] 12251 12365 12384 12391 12433 12445 12468 12506 12561 12605 12716 12755
## [373] 12766 12799 12820 12836 12843 12865 12882 12894 12903 12914 12964 12971
## [385] 12983 13044 13046 13075 13167 13216 13222 13227 13327 13365 13374 13382
## [397] 13401 13448 13473 13505 13508 13509 13517 13518 13521 13522 13553 13573
## [409] 13574 13608 13636 13641 13654 13662 13683 13690 13705 13761 13766 13775
## [421] 13782 13794 13865 13869 13903 13908 13909 13916 13925 13926 13939 13965
## [433] 13967 13969 13985 14019 14044 14063 14084 14088 14187 14193 14205 14207
## [445] 14209 14283 14309 14349 14407 14458 14481 14501 14565 14590 14601 14610
## [457] 14627 14640 14644 14667 14676 14684 14693 14822 14849 14852 14862 14909
## [469] 14969 14982 15011 15023 15024 15095 15116 15188 15221 15260 15279 15354
## [481] 15355 15366 15390 15421 15443 15475 15483 15484 15490 15510 15513 15549
## [493] 15559 15564 15616 15625 15629 15640 15670 15712 15771 15784 15815 15849
## [505] 15906 15907 15915 15920 15934 15952 15954 15958 15960 15967 15999 16000
## [517] 16097 16100 16105 16106 16130 16131 16154 16165 16174 16218 16234 16252
## [529] 16255 16315 16390 16424 16451 16456 16466 16468 16534 16546 16555 16562
## [541] 16563 16607 16608 16650 16654 16668 16672 16701 16765 16777 16781 16785
## [553] 16803 16829 16830 16834 16898 16924 16985 17004 17005 17046 17076 17149
## [565] 17173 17259 17311 17324 17351 17425 17439 17561 17609 17618 17707 17821
## [577] 17824 18092 18099 18100 18110 18147 18173 18186 18197 18214 18295 18380
## [589] 18410 18440 18451 18555 18649 18713 18821 18849 18850 18952 18999 19062
## [601] 19064 19136 19144 19195 19208 19257 19264 19274 19326 19355 19426 19436
## [613] 19446 19509 19571 19585 19604 19625 19695 19717 19722 19771 19825 19831
## [625] 19835 19948 20042 20045 20073 20101 20126 20203 20262 20267 20274 20293
## [637] 20340 20366 20389 20471 20554 20628 20657 20666 20722 20723 20733 20749
## [649] 20884 20911 20941 20956 21033 21083 21148 21151 21158 21187 21234 21286
## [661] 21349 21410 21420 21438 21664 21694 21746 21768 21795 21808 21812 21922
## [673] 21972 21994 22074 22173 22175 22183 22209 22212 22234 22237 22273 22325
## [685] 22366 22419 22585 22615 22729 22742 22753 22769 22770 22794 22821 22823
## [697] 22915 22921 22969 22976 22996 23028 23043 23119 23134 23341 23368 23433
## [709] 23452 23460 23582 23605 23612 23638 23675 23762 23820 23835 23911 24116
## [721] 24137 24160 24181 24319 24385 24386 24444 24455 24461 24495 24499 24549
## [733] 24639 24695 25158 25558 25817 25853 25887 26043 26090 26095 26315 26404
## [745] 26501 26871 27156 27514 27578
# Approximately 750 Projected MSR Dates are considered outliers because the kurtosis is high and the variable is skewed right.
#Plot
stripchart(FinalProjectData[,14], method = "stack")
#Mean
meanprojdisdate <- mean(FinalProjectData[,15], na.rm = TRUE)
meanprojdisdate
## [1] 48002.59
#Standard Deviation
sdprojdisdate <- sd(FinalProjectData[,15], na.rm = TRUE)
sdprojdisdate
## [1] 4085.952
#Sample Variance
varprojdisdate <- var(FinalProjectData[,15], na.rm = TRUE)
varprojdisdate
## [1] 16695001
#Skewness
skewprojdisdate <- skewness(FinalProjectData[,15], na.rm = TRUE)
skewprojdisdate
## [1] 2.08815
#Kurtosis
kurtprojdisdate <- kurtosis(FinalProjectData[,15], na.rm = TRUE)
kurtprojdisdate
## [1] 6.957268
#1D Outliers
which(abs(scale(FinalProjectData[,15]))>3)
## [1] 2 123 137 219 450 486 639 709 903 957 1016 1085
## [13] 1088 1095 1176 1363 1468 1478 1507 1594 1606 1678 1793 1834
## [25] 1862 1911 1915 1946 1952 1974 2026 2076 2091 2113 2131 2149
## [37] 2192 2207 2232 2238 2240 2274 2316 2333 2351 2360 2370 2380
## [49] 2414 2418 2460 2480 2494 2535 2599 2645 2662 2664 2672 2725
## [61] 2734 2752 2769 2771 2812 2850 2870 2885 2887 2894 2917 2929
## [73] 3022 3029 3051 3151 3175 3185 3268 3291 3359 3372 3402 3569
## [85] 3580 3588 3597 3606 3673 3674 3701 3771 3803 3828 3834 3842
## [97] 3844 3845 3854 3858 3859 3926 3943 3961 3987 4010 4029 4064
## [109] 4076 4079 4114 4140 4226 4274 4284 4359 4415 4419 4451 4453
## [121] 4544 4557 4558 4573 4594 4709 4724 4761 4782 4875 4879 4958
## [133] 5018 5051 5080 5105 5118 5120 5128 5150 5165 5183 5217 5223
## [145] 5238 5263 5284 5358 5379 5399 5463 5550 5587 5633 5697 5742
## [157] 5778 5819 5834 5907 5948 6018 6192 6208 6230 6240 6245 6262
## [169] 6268 6316 6341 6349 6382 6383 6426 6475 6480 6586 6627 6658
## [181] 6667 6679 6689 6696 6747 6815 6887 6912 6973 7057 7075 7190
## [193] 7209 7215 7219 7239 7278 7326 7357 7442 7458 7485 7494 7525
## [205] 7552 7637 7662 7672 7694 7741 7748 7761 7799 7847 7852 7855
## [217] 7906 7979 8057 8058 8080 8089 8249 8301 8312 8320 8347 8367
## [229] 8371 8379 8405 8419 8502 8581 8637 8651 8657 8812 8865 8876
## [241] 8892 8965 8983 9040 9048 9122 9258 9307 9309 9379 9414 9522
## [253] 9557 9559 9575 9616 9643 9646 9652 9673 9679 9738 9773 9784
## [265] 9837 9882 9901 9905 9926 9959 9987 10084 10106 10116 10121 10155
## [277] 10246 10297 10402 10421 10462 10492 10493 10535 10538 10556 10560 10573
## [289] 10599 10671 10685 10744 10769 10839 10867 10868 10884 10922 10939 10946
## [301] 10984 11026 11138 11161 11176 11224 11296 11298 11345 11413 11503 11706
## [313] 11748 11764 11775 11843 11882 11939 12251 12384 12391 12433 12468 12506
## [325] 12561 12608 12716 12732 12755 12766 12799 12865 12882 12894 12903 12914
## [337] 12964 12971 12983 13044 13075 13216 13222 13227 13327 13365 13374 13382
## [349] 13401 13448 13505 13508 13509 13517 13518 13521 13522 13553 13573 13608
## [361] 13636 13641 13649 13654 13662 13666 13683 13690 13705 13714 13740 13761
## [373] 13766 13775 13782 13794 13865 13869 13895 13903 13908 13909 13916 13926
## [385] 13934 13936 13939 13965 13967 13969 14008 14044 14088 14187 14193 14198
## [397] 14205 14209 14283 14309 14318 14349 14407 14456 14458 14481 14501 14565
## [409] 14590 14601 14610 14627 14631 14640 14644 14658 14667 14676 14684 14852
## [421] 14862 14909 14969 14982 15011 15044 15077 15095 15116 15161 15260 15279
## [433] 15354 15355 15366 15390 15421 15443 15475 15483 15484 15490 15510 15513
## [445] 15549 15559 15564 15616 15625 15629 15640 15754 15771 15784 15815 15849
## [457] 15907 15915 15920 15934 15952 15954 15958 15960 15967 15999 16000 16097
## [469] 16100 16106 16130 16154 16165 16174 16218 16234 16252 16255 16282 16315
## [481] 16384 16390 16424 16451 16456 16466 16468 16522 16546 16562 16650 16654
## [493] 16668 16765 16777 16781 16785 16803 16829 16830 16834 16837 16985 17004
## [505] 17005 17046 17050 17076 17149 17173 17259 17311 17324 17351 17425 17439
## [517] 17617 17707 17821 17824 17897 17905 18000 18092 18099 18100 18110 18147
## [529] 18173 18197 18214 18295 18341 18380 18428 18440 18451 18555 18649 18726
## [541] 18728 18781 18821 18849 18850 18852 18952 19062 19064 19104 19136 19144
## [553] 19195 19257 19274 19436 19509 19585 19604 19625 19681 19695 19717 19722
## [565] 19771 19825 19831 19835 19948 19993 20045 20073 20126 20164 20203 20262
## [577] 20267 20274 20293 20340 20366 20389 20471 20554 20628 20657 20666 20723
## [589] 20733 20749 20877 20884 20941 20956 21033 21073 21083 21148 21151 21158
## [601] 21187 21286 21377 21410 21420 21664 21694 21768 21812 21922 21994 22173
## [613] 22183 22209 22234 22273 22325 22366 22585 22615 22729 22753 22769 22821
## [625] 22823 22915 22969 22976 22996 23043 23119 23341 23368 23486 23605 23612
## [637] 23638 23675 23762 23820 23911 24116 24137 24160 24181 24319 24385 24386
## [649] 24455 24461 24499 24549 24614 24695 25158 25653 25680 25817 25853 25887
## [661] 26043 26095 26315 26404 26501 27006 27156 27514
# Approximately 700 Projected Discharge Dates are considered outliers because the kurtosis is high and the variable is skewed right.
#Plot
stripchart(FinalProjectData[,15], method = "stack")
#Mean
meancustodydate <- mean(FinalProjectData[,16])
meancustodydate
## [1] 41404.82
#Standard Deviation
sdcustodydate <- sd(FinalProjectData[,16])
sdcustodydate
## [1] 3138.06
#Sample Variance
varcustodydate <- var(FinalProjectData[,16])
varcustodydate
## [1] 9847422
#Skewness
skewcustodydate <- skewness(FinalProjectData[,16])
skewcustodydate
## [1] -1.430418
#Kurtosis
kurtcustodydate <- kurtosis(FinalProjectData[,16])
kurtcustodydate
## [1] 4.788124
#1D Outliers
which(abs(scale(FinalProjectData[,16]))>3)
## [1] 1 2 3 4 6 7 8 9 10 11 12 13
## [13] 14 16 17 24 28 31 35 39 41 42 44 45
## [25] 48 49 51 53 56 63 64 65 67 68 69 71
## [37] 75 77 79 80 81 83 85 87 89 90 92 97
## [49] 98 99 112 113 115 116 117 122 129 140 141 150
## [61] 155 156 160 163 170 172 173 178 181 183 187 193
## [73] 197 200 201 205 206 216 218 229 235 240 252 254
## [85] 256 257 260 270 274 278 283 284 285 293 295 301
## [97] 305 309 316 317 319 327 330 332 336 337 338 339
## [109] 340 345 348 354 371 373 380 383 386 434 484 542
## [121] 544 550 563 719 873 1030 3818 3819 3820 3821 3822 3823
## [133] 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835
## [145] 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847
## [157] 3848 3849 3851 3852 3853 3854 3855 3856 3857 3858 3859 6139
## [169] 6140 11206 11209 11212 11215 11216 11221 11222 11225 11227 11232 11234
## [181] 11238 11239 11242 11244 11245 11250 11253 11255 11266 11269 11270 11272
## [193] 11274 11278 11280 11281 11284 11288 11302 11308 11312 11313 11314 11317
## [205] 11319 11321 11322 11324 11328 11329 11331 11333 11340 11341 11344 11346
## [217] 11349 11352 11355 11356 11358 11364 11379 11384 11390 11411 11418 11423
## [229] 11452 11454 11458 11459 11468 11472 11480 11487 11491 11497 11498 11499
## [241] 11504 11507 11514 11520 11523 11526 11532 11537 11540 11544 11548 11555
## [253] 11569 11570 11573 11600 11615 11623 11625 11626 11627 11629 11635 11636
## [265] 11637 11639 11641 11642 11656 11659 11664 11666 11668 11686 11689 11690
## [277] 11694 11700 11705 11711 11712 11715 11716 11724 11736 11737 11744 11750
## [289] 11766 11769 11770 11773 11774 11781 11783 11803 11804 11806 11815 11823
## [301] 11827 11831 11833 11846 11851 11852 11853 11857 11860 11871 11873 11877
## [313] 11880 11887 11888 11897 11899 11905 11919 11935 11948 11951 11953 11958
## [325] 11966 11969 11972 11975 11993 12003 12007 12018 12019 12021 12023 12024
## [337] 12029 12033 12034 12045 12049 12056 12057 12069 12085 12086 12089 12090
## [349] 12093 12094 12096 12102 12103 12105 12107 12118 12124 12134 12141 12150
## [361] 12151 12162 12164 12169 12170 12173 12174 12175 12183 12184 12190 12209
## [373] 12217 12241 12246 12252 12262 12263 12264 12269 12270 12271 12276 12283
## [385] 12284 12286 12288 12289 12297 12299 12307 12314 12315 12316 12319 12324
## [397] 12325 12329 12345 12348 12351 12373 12390 12401 12434 12441 12463 12478
## [409] 12508 12539 12550 12553 12566 12591 12592 12596 12597 12670 12711 12723
# Approximately 450 Custody Dates are considered outliers because the variable is skewed left.
#Plot
stripchart(FinalProjectData[,16], method = "stack")
#Mean
meansentdate <- mean(FinalProjectData[,17])
meansentdate
## [1] 41958.47
#Standard Deviation
sdsentdate <- sd(FinalProjectData[,17])
sdsentdate
## [1] 2981.937
#Sample Variance
varsentdate <- var(FinalProjectData[,17])
varsentdate
## [1] 8891946
#Skewness
skewsentdate <- skewness(FinalProjectData[,17])
skewsentdate
## [1] -1.650769
#Kurtosis
kurtsentdate <- kurtosis(FinalProjectData[,17])
kurtsentdate
## [1] 5.653045
#1D Outliers
which(abs(scale(FinalProjectData[,17]))>3)
## [1] 1 2 3 4 6 7 8 9 10 11 12 13
## [13] 14 16 17 24 28 31 35 37 39 41 42 44
## [25] 45 48 49 51 53 56 63 64 65 66 67 68
## [37] 69 71 75 77 79 80 81 83 85 87 89 90
## [49] 92 96 97 98 99 113 115 116 117 118 122 128
## [61] 129 131 140 141 150 156 160 163 164 170 172 173
## [73] 178 181 183 187 188 193 196 197 200 201 205 206
## [85] 216 218 228 229 235 239 240 252 254 256 257 260
## [97] 270 274 278 283 285 293 295 301 305 309 312 316
## [109] 317 318 319 330 332 334 336 337 338 339 340 345
## [121] 349 354 371 373 380 381 383 401 404 406 413 414
## [133] 423 426 432 458 460 484 492 494 497 507 520 542
## [145] 550 609 612 631 659 719 734 3818 3819 3820 3821 3822
## [157] 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834
## [169] 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846
## [181] 3847 3848 3849 3851 3852 3853 3854 3855 3856 3857 3858 3859
## [193] 6139 6140 6340 11193 11206 11209 11212 11215 11216 11221 11222 11223
## [205] 11225 11227 11232 11233 11234 11238 11239 11241 11242 11244 11250 11253
## [217] 11255 11257 11266 11267 11269 11270 11272 11274 11278 11280 11281 11284
## [229] 11288 11297 11300 11308 11310 11312 11313 11314 11317 11319 11321 11322
## [241] 11324 11328 11329 11331 11341 11344 11346 11349 11352 11355 11356 11358
## [253] 11364 11379 11384 11390 11399 11410 11411 11418 11423 11431 11435 11442
## [265] 11446 11447 11450 11452 11454 11458 11459 11468 11472 11480 11487 11491
## [277] 11498 11499 11504 11507 11514 11520 11523 11526 11532 11537 11544 11548
## [289] 11555 11567 11569 11570 11573 11578 11584 11600 11615 11618 11623 11625
## [301] 11626 11627 11635 11636 11637 11639 11641 11642 11656 11659 11664 11666
## [313] 11668 11685 11686 11689 11690 11694 11699 11700 11705 11711 11712 11715
## [325] 11716 11724 11737 11744 11750 11766 11769 11770 11773 11774 11781 11783
## [337] 11803 11804 11806 11815 11823 11827 11831 11833 11846 11851 11852 11853
## [349] 11857 11860 11871 11873 11877 11880 11887 11888 11897 11899 11905 11912
## [361] 11919 11929 11935 11948 11951 11953 11958 11966 11969 11972 11993 12003
## [373] 12007 12009 12019 12023 12024 12029 12033 12045 12049 12056 12057 12069
## [385] 12084 12085 12086 12089 12090 12092 12094 12096 12100 12102 12103 12105
## [397] 12107 12118 12124 12134 12141 12145 12151 12162 12164 12169 12170 12173
## [409] 12174 12175 12183 12184 12190 12209 12217 12241 12252 12262 12263 12264
## [421] 12269 12270 12271 12276 12283 12284 12286 12288 12289 12297 12299 12307
## [433] 12314 12315 12316 12319 12324 12325 12329 12345 12348 12351 12353 12357
## [445] 12371 12373 12387 12390 12394 12400 12401 12422 12424 12434 12437 12441
## [457] 12459 12462 12463 12478 12483 12491 12508 12521 12539 12544 12546 12550
## [469] 12553 12562 12566 12571 12572 12586 12591 12592 12596 12597 12599 12601
## [481] 12626 12641 12645 12653 12654 12657 12668 12670 12672 12673 12674 12684
## [493] 12690 12699 12711 12720 12723 15460 17646 25394
# Approximately 500 Sentence Dates are considered outliers because the variable is skewed left.
#Plot
stripchart(FinalProjectData[,17], method = "stack")
#Mean
mean_class_one <- mean(FinalProjectData[,18])
mean_class_one
## [1] 0.1230836
#Standard Deviation
sd_class_one <- sd(FinalProjectData[,18])
sd_class_one
## [1] 0.328539
#Sample Variance
var_class_one <- var(FinalProjectData[,18])
var_class_one
## [1] 0.1079379
#Skewness
skew_class_one <- skewness(FinalProjectData[,18])
skew_class_one
## [1] 2.294542
#Kurtosis
kurt_class_one <- kurtosis(FinalProjectData[,18])
kurt_class_one
## [1] 6.264922
#1D Outliers
which(abs(scale(FinalProjectData[,18]))>3)
## integer(0)
#Plot
stripchart(FinalProjectData[,18], method = "stack")
#Mean
mean_class_two <- mean(FinalProjectData[,19])
mean_class_two
## [1] 0.1722739
#Standard Deviation
sd_class_two <- sd(FinalProjectData[,19])
sd_class_two
## [1] 0.3776251
#Sample Variance
var_class_two <- var(FinalProjectData[,19])
var_class_two
## [1] 0.1426007
#Skewness
skew_class_two <- skewness(FinalProjectData[,19])
skew_class_two
## [1] 1.735753
#Kurtosis
kurt_class_two <- kurtosis(FinalProjectData[,19])
kurt_class_two
## [1] 4.012839
#1D Outliers
which(abs(scale(FinalProjectData[,19]))>3)
## integer(0)
#Plot
stripchart(FinalProjectData[,19], method = "stack")
#Mean
mean_class_three <- mean(FinalProjectData[,20])
mean_class_three
## [1] 0.07339054
#Standard Deviation
sd_class_three <- sd(FinalProjectData[,20])
sd_class_three
## [1] 0.2607812
#Sample Variance
var_class_three <- var(FinalProjectData[,20])
var_class_three
## [1] 0.06800681
#Skewness
skew_class_three <- skewness(FinalProjectData[,20])
skew_class_three
## [1] 3.27184
#Kurtosis
kurt_class_three <- kurtosis(FinalProjectData[,20])
kurt_class_three
## [1] 11.70494
#1D Outliers
which(abs(scale(FinalProjectData[,20]))>3)
## [1] 35 50 74 91 215 234 288 328 366 370 388 399
## [13] 417 445 463 468 475 476 477 506 538 562 592 657
## [25] 658 681 721 793 833 846 851 945 954 960 988 1009
## [37] 1010 1011 1017 1018 1033 1062 1064 1077 1079 1089 1101 1128
## [49] 1135 1136 1144 1147 1174 1175 1177 1189 1195 1212 1221 1228
## [61] 1233 1236 1242 1260 1273 1280 1285 1290 1322 1326 1331 1332
## [73] 1335 1366 1380 1388 1415 1443 1453 1496 1501 1528 1550 1571
## [85] 1607 1617 1621 1644 1649 1655 1669 1706 1742 1787 1798 1841
## [97] 1851 1854 1861 1870 1882 1912 1913 1923 1962 2003 2007 2010
## [109] 2071 2075 2107 2115 2174 2213 2226 2256 2322 2331 2391 2428
## [121] 2430 2468 2469 2512 2524 2529 2534 2578 2585 2586 2602 2606
## [133] 2623 2632 2653 2673 2678 2679 2692 2705 2786 2806 2832 2842
## [145] 2853 2867 2891 2905 2927 2941 2944 2950 2963 2980 2981 2984
## [157] 2987 2988 3006 3007 3010 3033 3045 3060 3065 3070 3075 3082
## [169] 3089 3101 3116 3131 3148 3150 3152 3163 3172 3174 3178 3180
## [181] 3186 3193 3198 3200 3210 3228 3243 3260 3279 3285 3292 3294
## [193] 3305 3317 3322 3323 3346 3349 3361 3376 3378 3389 3406 3414
## [205] 3418 3440 3441 3452 3460 3469 3496 3500 3513 3514 3525 3535
## [217] 3541 3574 3581 3617 3624 3627 3628 3652 3690 3694 3700 3708
## [229] 3710 3719 3725 3729 3732 3738 3743 3753 3773 3777 3784 3786
## [241] 3797 3804 3808 3812 3815 3863 3865 3870 3875 3897 3907 3908
## [253] 3919 3934 3937 3941 3958 3960 3972 3974 3993 4049 4124 4130
## [265] 4175 4192 4232 4273 4281 4360 4365 4408 4462 4490 4495 4509
## [277] 4529 4531 4536 4542 4545 4547 4601 4607 4701 4767 4777 4802
## [289] 4834 4873 4957 4988 5004 5033 5039 5083 5158 5188 5209 5264
## [301] 5272 5283 5291 5305 5348 5489 5512 5558 5560 5562 5564 5577
## [313] 5585 5597 5603 5622 5626 5643 5649 5650 5659 5668 5707 5714
## [325] 5736 5738 5751 5765 5766 5767 5803 5825 5828 5842 5852 5853
## [337] 5899 5912 5916 5923 5928 5968 5976 5989 5992 6004 6005 6007
## [349] 6019 6026 6035 6041 6049 6065 6069 6070 6074 6076 6093 6102
## [361] 6119 6122 6128 6148 6152 6178 6193 6198 6229 6275 6297 6305
## [373] 6307 6315 6359 6370 6399 6406 6410 6412 6417 6520 6532 6556
## [385] 6589 6626 6636 6669 6676 6698 6709 6713 6720 6721 6722 6863
## [397] 6915 6917 6919 6920 6924 6982 6990 7011 7066 7109 7118 7175
## [409] 7188 7192 7238 7248 7254 7258 7282 7298 7307 7320 7343 7372
## [421] 7389 7391 7436 7496 7508 7527 7549 7557 7580 7597 7628 7678
## [433] 7696 7719 7753 7767 7782 7829 7876 7882 7913 7936 7938 7960
## [445] 8005 8062 8072 8081 8084 8100 8127 8135 8170 8192 8240 8274
## [457] 8276 8277 8278 8283 8296 8317 8336 8341 8354 8372 8396 8413
## [469] 8415 8416 8420 8423 8481 8506 8535 8545 8626 8682 8689 8695
## [481] 8697 8726 8729 8781 8840 8898 8930 8939 8959 8964 9004 9029
## [493] 9046 9057 9066 9088 9102 9128 9144 9158 9164 9188 9197 9212
## [505] 9213 9236 9256 9273 9275 9313 9318 9332 9359 9365 9368 9400
## [517] 9401 9405 9428 9429 9440 9454 9496 9497 9499 9515 9531 9548
## [529] 9585 9620 9623 9634 9649 9697 9714 9726 9730 9781 9826 9883
## [541] 9890 9899 9904 9974 9978 9999 10008 10027 10101 10127 10156 10172
## [553] 10203 10222 10247 10256 10266 10277 10281 10300 10313 10356 10358 10363
## [565] 10431 10434 10509 10514 10537 10569 10590 10626 10645 10646 10649 10657
## [577] 10664 10669 10691 10709 10750 10765 10788 10822 10861 10864 10872 10896
## [589] 10959 10973 10986 11006 11044 11050 11087 11090 11145 11165 11170 11175
## [601] 11203 11260 11303 11326 11371 11380 11403 11415 11443 11451 11473 11488
## [613] 11534 11547 11576 11580 11638 11647 11654 11660 11683 11695 11696 11707
## [625] 11721 11722 11755 11778 11782 11787 11792 11801 11808 11810 11842 11845
## [637] 11849 11858 11896 11913 11940 11942 11947 11956 11984 11999 12106 12109
## [649] 12115 12120 12158 12165 12274 12285 12294 12322 12360 12363 12383 12386
## [661] 12409 12415 12416 12456 12474 12475 12484 12485 12498 12531 12548 12580
## [673] 12624 12660 12691 12703 12705 12747 12754 12829 12848 12853 12886 12899
## [685] 12969 12996 13050 13082 13087 13119 13123 13133 13170 13174 13201 13237
## [697] 13238 13240 13241 13243 13250 13254 13332 13339 13357 13370 13391 13405
## [709] 13426 13444 13462 13489 13492 13496 13512 13532 13578 13593 13599 13606
## [721] 13620 13626 13646 13695 13697 13752 13773 13792 13804 13851 13863 13884
## [733] 13944 13950 13978 14033 14081 14096 14112 14113 14149 14214 14223 14243
## [745] 14246 14314 14328 14329 14332 14350 14384 14411 14443 14452 14461 14462
## [757] 14474 14476 14484 14485 14517 14531 14584 14587 14606 14645 14646 14690
## [769] 14716 14718 14723 14726 14741 14751 14767 14780 14787 14789 14795 14797
## [781] 14841 14846 14871 14877 14884 14904 14917 14918 14978 15002 15015 15052
## [793] 15064 15128 15129 15144 15154 15157 15164 15170 15172 15174 15217 15224
## [805] 15294 15379 15384 15395 15515 15529 15555 15663 15666 15677 15685 15689
## [817] 15691 15734 15747 15759 15803 15829 15873 15889 15940 15957 15969 15983
## [829] 16015 16062 16068 16070 16092 16119 16144 16172 16176 16202 16220 16233
## [841] 16266 16279 16292 16293 16331 16340 16341 16343 16372 16377 16389 16423
## [853] 16425 16440 16448 16458 16477 16495 16521 16577 16588 16591 16592 16616
## [865] 16636 16637 16654 16660 16694 16707 16734 16735 16773 16792 16815 16816
## [877] 16854 16868 16874 16896 16899 16911 16914 16934 16948 17006 17011 17033
## [889] 17072 17080 17088 17089 17096 17101 17105 17109 17116 17123 17140 17143
## [901] 17172 17238 17262 17266 17278 17287 17294 17298 17310 17314 17329 17338
## [913] 17344 17390 17398 17403 17423 17436 17441 17449 17460 17462 17468 17470
## [925] 17475 17479 17482 17485 17486 17487 17490 17491 17495 17500 17504 17511
## [937] 17514 17518 17520 17529 17539 17540 17543 17545 17549 17550 17562 17566
## [949] 17567 17571 17574 17575 17576 17577 17583 17588 17599 17622 17641 17648
## [961] 17651 17658 17667 17670 17671 17674 17696 17704 17710 17723 17739 17746
## [973] 17751 17755 17757 17758 17764 17773 17793 17794 17795 17796 17798 17812
## [985] 17813 17828 17829 17863 17868 17885 17886 17891 17911 17914 17929 17933
## [997] 17944 17959 17966 17970 17972 17975 17983 18005 18006 18007 18010 18018
## [1009] 18021 18024 18043 18053 18058 18061 18079 18091 18103 18114 18124 18133
## [1021] 18138 18139 18143 18144 18148 18159 18162 18169 18178 18180 18187 18211
## [1033] 18215 18232 18238 18239 18245 18253 18259 18262 18266 18274 18290 18297
## [1045] 18303 18310 18325 18342 18356 18360 18366 18368 18394 18395 18435 18445
## [1057] 18458 18462 18464 18470 18474 18479 18482 18483 18500 18512 18515 18521
## [1069] 18526 18542 18543 18546 18547 18566 18568 18575 18581 18592 18603 18611
## [1081] 18612 18630 18633 18647 18650 18675 18679 18682 18689 18719 18721 18724
## [1093] 18751 18753 18758 18763 18769 18773 18776 18784 18786 18807 18820 18822
## [1105] 18827 18831 18835 18838 18848 18862 18866 18875 18880 18882 18886 18888
## [1117] 18895 18922 18924 18939 18945 18947 18950 18966 18970 18971 18983 18986
## [1129] 18988 18989 19005 19015 19016 19020 19047 19049 19069 19072 19078 19079
## [1141] 19109 19130 19162 19166 19170 19179 19199 19252 19253 19268 19289 19291
## [1153] 19296 19309 19319 19339 19368 19382 19386 19402 19409 19415 19463 19487
## [1165] 19491 19527 19535 19564 19567 19569 19575 19587 19602 19629 19652 19664
## [1177] 19665 19669 19684 19700 19701 19710 19726 19749 19763 19768 19775 19793
## [1189] 19794 19809 19820 19823 19827 19837 19845 19849 19880 19881 19894 19914
## [1201] 19939 19942 19945 19950 19952 19957 19960 20000 20027 20031 20034 20038
## [1213] 20054 20064 20068 20071 20075 20076 20078 20083 20092 20108 20124 20135
## [1225] 20142 20190 20230 20276 20297 20304 20311 20324 20381 20405 20423 20428
## [1237] 20445 20447 20451 20462 20465 20504 20515 20533 20542 20546 20551 20555
## [1249] 20561 20569 20574 20584 20593 20648 20650 20658 20664 20669 20674 20696
## [1261] 20701 20710 20760 20766 20767 20783 20799 20862 20886 20907 20940 20946
## [1273] 20949 20994 21021 21024 21026 21039 21050 21064 21076 21097 21117 21119
## [1285] 21163 21170 21184 21204 21228 21241 21246 21255 21258 21269 21294 21344
## [1297] 21353 21357 21383 21422 21463 21466 21471 21479 21496 21497 21528 21569
## [1309] 21578 21590 21625 21631 21646 21652 21708 21713 21747 21816 21818 21822
## [1321] 21832 21837 21838 21839 21854 21864 21880 21909 21911 21979 21986 22009
## [1333] 22085 22100 22105 22122 22126 22157 22193 22206 22221 22284 22326 22392
## [1345] 22406 22422 22432 22456 22483 22494 22503 22514 22532 22533 22539 22550
## [1357] 22612 22613 22631 22662 22699 22712 22721 22734 22797 22833 22844 22868
## [1369] 22909 22945 22953 22957 23012 23020 23033 23060 23091 23092 23106 23113
## [1381] 23138 23141 23158 23163 23177 23184 23188 23242 23266 23270 23272 23285
## [1393] 23311 23332 23382 23389 23435 23500 23505 23506 23517 23518 23565 23570
## [1405] 23591 23653 23665 23672 23709 23725 23727 23748 23758 23759 23772 23790
## [1417] 23807 23824 23831 23838 23843 23848 23854 23913 23923 23931 23936 23993
## [1429] 23999 24001 24002 24010 24012 24017 24024 24029 24033 24036 24069 24070
## [1441] 24072 24086 24102 24152 24165 24196 24211 24222 24235 24241 24251 24253
## [1453] 24275 24279 24297 24298 24302 24310 24325 24333 24339 24351 24359 24379
## [1465] 24382 24384 24397 24434 24436 24458 24488 24515 24516 24521 24548 24553
## [1477] 24557 24562 24563 24567 24568 24569 24592 24595 24598 24605 24612 24643
## [1489] 24668 24675 24680 24709 24723 24725 24727 24734 24748 24752 24756 24760
## [1501] 24765 24773 24795 24799 24806 24812 24830 24855 24860 24861 24872 24875
## [1513] 24876 24883 24886 24902 24911 24921 24943 24944 24945 24946 24947 24956
## [1525] 24988 24989 24991 24994 25010 25020 25031 25032 25038 25040 25046 25061
## [1537] 25072 25090 25096 25098 25109 25112 25130 25131 25133 25136 25144 25148
## [1549] 25153 25156 25161 25167 25175 25200 25206 25213 25222 25231 25233 25236
## [1561] 25240 25245 25255 25259 25265 25271 25297 25301 25307 25312 25314 25315
## [1573] 25318 25322 25326 25334 25337 25343 25348 25380 25390 25398 25399 25413
## [1585] 25419 25420 25430 25433 25437 25442 25444 25447 25451 25458 25461 25463
## [1597] 25465 25471 25477 25479 25485 25501 25505 25506 25512 25520 25533 25535
## [1609] 25542 25545 25546 25549 25557 25561 25591 25592 25597 25598 25602 25606
## [1621] 25607 25612 25615 25620 25623 25626 25628 25630 25631 25632 25633 25635
## [1633] 25639 25649 25660 25684 25689 25690 25691 25695 25699 25702 25703 25719
## [1645] 25726 25736 25740 25744 25747 25756 25766 25767 25770 25776 25779 25782
## [1657] 25787 25795 25796 25802 25803 25805 25813 25818 25822 25823 25824 25825
## [1669] 25836 25841 25854 25855 25871 25873 25875 25905 25916 25917 25925 25926
## [1681] 25929 25940 25942 25944 25947 25962 25963 25966 25978 25979 25980 25983
## [1693] 25989 25994 26011 26026 26036 26042 26076 26093 26096 26109 26112 26117
## [1705] 26118 26128 26139 26151 26152 26157 26159 26167 26169 26171 26173 26180
## [1717] 26181 26197 26201 26202 26203 26216 26220 26221 26222 26224 26226 26236
## [1729] 26240 26242 26246 26254 26267 26274 26278 26282 26287 26299 26312 26346
## [1741] 26347 26352 26358 26372 26377 26384 26392 26407 26408 26413 26432 26434
## [1753] 26445 26447 26449 26450 26453 26462 26467 26470 26479 26485 26486 26488
## [1765] 26492 26494 26495 26497 26499 26507 26514 26525 26526 26528 26531 26542
## [1777] 26545 26547 26553 26564 26570 26571 26584 26591 26593 26598 26603 26606
## [1789] 26609 26624 26628 26629 26639 26643 26644 26645 26649 26650 26652 26655
## [1801] 26663 26668 26674 26676 26679 26680 26682 26683 26686 26689 26692 26695
## [1813] 26699 26705 26711 26712 26715 26718 26731 26735 26736 26737 26739 26755
## [1825] 26756 26763 26773 26779 26783 26793 26794 26795 26796 26799 26804 26811
## [1837] 26816 26821 26823 26827 26828 26831 26832 26833 26842 26849 26854 26862
## [1849] 26863 26865 26868 26869 26887 26889 26898 26901 26905 26922 26926 26931
## [1861] 26938 26941 26942 26945 26962 26964 26970 26971 26975 26978 26981 26984
## [1873] 26985 26987 26995 26996 27005 27007 27014 27022 27027 27030 27034 27041
## [1885] 27043 27044 27047 27051 27055 27061 27064 27076 27082 27083 27097 27099
## [1897] 27100 27102 27106 27108 27110 27111 27122 27124 27128 27129 27131 27132
## [1909] 27134 27150 27162 27170 27174 27178 27181 27186 27198 27202 27203 27212
## [1921] 27215 27218 27230 27235 27236 27240 27256 27258 27266 27271 27276 27278
## [1933] 27285 27286 27287 27289 27290 27293 27303 27308 27310 27311 27312 27314
## [1945] 27324 27333 27353 27372 27376 27386 27388 27389 27393 27397 27399 27403
## [1957] 27416 27429 27448 27451 27453 27454 27457 27466 27468 27472 27479 27483
## [1969] 27484 27486 27487 27491 27505 27509 27510 27513 27518 27523 27526 27532
## [1981] 27533 27536 27541 27542 27562 27567 27569 27579 27581 27583 27593 27597
## [1993] 27603 27610 27617 27628 27631 27642 27652 27656 27661 27662 27667 27668
## [2005] 27680 27686 27687 27691 27694 27703 27706 27711 27714 27718 27719 27720
## [2017] 27721 27727 27743 27744 27745 27749 27761 27762 27766 27768 27769 27773
## [2029] 27774 27775 27776 27779 27783 27787 27788 27796 27797 27798 27812 27813
## [2041] 27816 27817 27840 27848
# All 2044 Class 3 prisoners are considered outliers because there are so few of them.
#Plot
stripchart(FinalProjectData[,20], method = "stack")
#Mean
mean_class_four <- mean(FinalProjectData[,21])
mean_class_four
## [1] 0.05256544
#Standard Deviation
sd_class_four <- sd(FinalProjectData[,21])
sd_class_four
## [1] 0.2231683
#Sample Variance
var_class_four <- var(FinalProjectData[,21])
var_class_four
## [1] 0.0498041
#Skewness
skew_class_four <- skewness(FinalProjectData[,21])
skew_class_four
## [1] 4.009911
#Kurtosis
kurt_class_four <- kurtosis(FinalProjectData[,21])
kurt_class_four
## [1] 17.07939
#1D Outliers
which(abs(scale(FinalProjectData[,21]))>3)
## [1] 138 286 321 351 369 375 387 441 457 517 546 551
## [13] 572 574 584 598 662 671 677 682 683 684 693 708
## [25] 730 738 740 759 761 773 831 880 885 890 917 942
## [37] 949 952 981 993 994 1014 1056 1093 1139 1246 1249 1283
## [49] 1284 1300 1351 1374 1385 1407 1413 1416 1419 1436 1445 1467
## [61] 1483 1484 1490 1567 1588 1618 1705 1719 1725 1755 1842 1917
## [73] 1926 1957 1961 1978 2009 2029 2031 2047 2082 2101 2152 2168
## [85] 2178 2210 2224 2237 2277 2285 2302 2323 2327 2342 2363 2368
## [97] 2383 2410 2489 2570 2581 2670 2688 2693 2719 2720 2742 2746
## [109] 2788 2803 2846 2879 2935 2999 3021 3041 3047 3055 3071 3108
## [121] 3128 3133 3137 3190 3192 3214 3236 3246 3249 3261 3315 3319
## [133] 3326 3328 3347 3363 3390 3392 3399 3431 3454 3458 3462 3479
## [145] 3482 3506 3556 3560 3609 3632 3664 3665 3668 3688 3713 3733
## [157] 3742 3763 3780 3789 3873 3876 3965 3973 4044 4112 4127 4148
## [169] 4200 4207 4262 4266 4314 4348 4352 4364 4420 4428 4489 4535
## [181] 4592 4598 4623 4632 4652 4655 4662 4667 4714 4760 4765 4826
## [193] 4881 4884 4899 4963 4986 5029 5059 5061 5081 5095 5111 5125
## [205] 5161 5189 5198 5200 5201 5215 5221 5237 5243 5288 5295 5297
## [217] 5359 5380 5390 5403 5425 5485 5488 5592 5612 5624 5658 5675
## [229] 5693 5703 5704 5718 5727 5733 5744 5746 5747 5750 5758 5770
## [241] 5781 5787 5838 5862 5939 5944 5959 5961 5963 5999 6047 6056
## [253] 6081 6101 6111 6120 6127 6129 6161 6199 6212 6217 6231 6242
## [265] 6259 6281 6288 6311 6337 6351 6354 6366 6367 6408 6436 6485
## [277] 6488 6515 6521 6568 6570 6571 6577 6590 6703 6711 6751 6761
## [289] 6790 6798 6807 6828 6847 6993 7018 7034 7085 7096 7100 7145
## [301] 7149 7151 7156 7189 7227 7242 7257 7318 7325 7327 7330 7399
## [313] 7448 7465 7486 7517 7579 7581 7670 7682 7685 7697 7750 7790
## [325] 7811 7817 7825 7862 7874 7880 7899 7900 7963 7981 7991 8026
## [337] 8039 8053 8120 8129 8141 8166 8183 8223 8261 8272 8327 8388
## [349] 8406 8421 8475 8503 8525 8555 8559 8587 8633 8679 8711 8725
## [361] 8762 8767 8805 8825 8870 8875 8884 8928 8934 8976 8981 8985
## [373] 8990 9026 9051 9070 9096 9108 9109 9143 9149 9214 9222 9225
## [385] 9249 9291 9312 9321 9337 9382 9383 9399 9455 9562 9566 9651
## [397] 9705 9724 9741 9750 9753 9798 9817 9829 9841 9867 10022 10046
## [409] 10058 10083 10100 10134 10142 10144 10193 10272 10295 10312 10316 10396
## [421] 10401 10439 10486 10515 10528 10548 10553 10593 10616 10618 10627 10632
## [433] 10684 10851 10855 10879 10888 10897 10954 10968 10978 10988 11032 11053
## [445] 11072 11085 11115 11135 11146 11169 11188 11271 11283 11309 11330 11370
## [457] 11417 11464 11564 11599 11602 11616 11697 11704 11728 11834 11875 11885
## [469] 11910 11959 11962 12032 12066 12082 12172 12196 12213 12278 12279 12352
## [481] 12375 12419 12420 12423 12439 12454 12465 12466 12467 12496 12513 12528
## [493] 12535 12549 12554 12564 12574 12671 12681 12692 12698 12706 12727 12741
## [505] 12787 12792 12901 12906 12907 12947 12954 12960 12966 12982 12985 13036
## [517] 13048 13063 13153 13169 13199 13270 13282 13302 13337 13369 13403 13418
## [529] 13464 13480 13506 13521 13563 13605 13671 13677 13678 13681 13717 13751
## [541] 13787 13850 13856 13881 13905 14000 14011 14021 14032 14199 14200 14250
## [553] 14257 14258 14285 14303 14323 14352 14355 14362 14383 14416 14418 14426
## [565] 14467 14469 14506 14518 14540 14547 14548 14589 14647 14649 14664 14675
## [577] 14700 14711 14761 14811 14820 14858 14899 14951 14977 14998 15062 15078
## [589] 15127 15196 15209 15239 15261 15264 15272 15273 15329 15333 15339 15380
## [601] 15392 15400 15414 15444 15456 15473 15489 15514 15530 15532 15547 15562
## [613] 15583 15597 15643 15661 15664 15682 15687 15715 15719 15723 15725 15752
## [625] 15755 15765 15779 15826 15888 15902 15913 15929 15930 15953 15982 15985
## [637] 16004 16007 16027 16046 16060 16095 16111 16116 16120 16143 16147 16173
## [649] 16178 16215 16222 16226 16236 16249 16267 16284 16310 16330 16350 16380
## [661] 16382 16402 16407 16409 16422 16431 16485 16531 16538 16579 16590 16601
## [673] 16615 16647 16706 16736 16759 16784 16859 16876 16886 16902 16912 16995
## [685] 16999 17029 17068 17075 17093 17153 17163 17174 17212 17213 17216 17217
## [697] 17221 17223 17225 17265 17267 17312 17332 17355 17360 17365 17372 17383
## [709] 17386 17389 17415 17416 17455 17456 17457 17459 17488 17489 17505 17507
## [721] 17519 17536 17541 17557 17608 17610 17615 17634 17638 17653 17692 17700
## [733] 17720 17725 17726 17737 17756 17790 17804 17810 17814 17820 17823 17833
## [745] 17842 17844 17846 17896 17902 17938 17958 17978 17998 18008 18015 18034
## [757] 18051 18056 18068 18087 18093 18098 18104 18129 18134 18141 18152 18164
## [769] 18168 18185 18198 18226 18230 18233 18258 18277 18291 18316 18337 18346
## [781] 18347 18348 18355 18374 18400 18418 18427 18430 18449 18456 18484 18485
## [793] 18492 18496 18497 18503 18505 18530 18533 18535 18545 18559 18563 18577
## [805] 18586 18594 18596 18609 18610 18614 18629 18643 18678 18703 18714 18717
## [817] 18718 18720 18756 18768 18790 18791 18794 18800 18802 18816 18858 18897
## [829] 18915 18927 18932 18936 18944 18958 18981 18998 19008 19011 19024 19029
## [841] 19033 19060 19087 19207 19221 19276 19320 19338 19379 19408 19445 19448
## [853] 19453 19498 19502 19505 19517 19531 19546 19577 19633 19644 19730 19734
## [865] 19737 19778 19804 19847 19850 19868 19882 19912 19955 20015 20021 20070
## [877] 20104 20105 20130 20131 20148 20222 20224 20271 20296 20314 20316 20364
## [889] 20379 20404 20411 20416 20419 20536 20557 20572 20596 20603 20608 20610
## [901] 20612 20618 20676 20689 20702 20714 20756 20776 20789 20844 20858 20865
## [913] 20883 20891 20921 21012 21032 21086 21110 21128 21138 21157 21162 21171
## [925] 21197 21249 21284 21296 21354 21356 21379 21415 21478 21493 21498 21518
## [937] 21551 21570 21598 21603 21612 21621 21628 21671 21679 21684 21686 21687
## [949] 21724 21725 21764 21783 21785 21835 21989 21996 22012 22013 22028 22052
## [961] 22104 22114 22136 22214 22300 22303 22321 22349 22388 22420 22484 22504
## [973] 22528 22531 22574 22606 22611 22636 22637 22644 22651 22656 22698 22705
## [985] 22749 22793 22845 22890 22920 22925 22997 23069 23101 23117 23120 23150
## [997] 23208 23231 23259 23336 23365 23373 23438 23458 23461 23492 23510 23513
## [1009] 23526 23527 23532 23585 23600 23642 23694 23699 23728 23752 23754 23766
## [1021] 23776 23813 23855 23875 23930 23943 23945 23963 23977 24040 24046 24063
## [1033] 24066 24113 24133 24158 24161 24175 24189 24200 24213 24226 24230 24240
## [1045] 24252 24263 24269 24277 24289 24300 24304 24305 24344 24356 24381 24396
## [1057] 24410 24415 24418 24419 24420 24422 24448 24492 24494 24503 24513 24524
## [1069] 24536 24542 24573 24664 24665 24691 24703 24706 24711 24729 24730 24751
## [1081] 24767 24768 24772 24785 24796 24828 24846 24847 24858 24864 24869 24882
## [1093] 24891 24895 24915 24924 24961 24964 24995 25023 25064 25116 25132 25146
## [1105] 25169 25176 25178 25181 25182 25210 25242 25263 25267 25273 25292 25296
## [1117] 25330 25331 25346 25353 25363 25378 25448 25452 25492 25515 25517 25526
## [1129] 25573 25580 25594 25596 25619 25637 25640 25655 25665 25675 25718 25753
## [1141] 25755 25785 25792 25804 25837 25840 25846 25888 25891 25908 25914 25919
## [1153] 25922 25928 25930 25933 25938 25957 25968 25982 25990 25995 26015 26037
## [1165] 26041 26044 26073 26074 26077 26081 26089 26097 26113 26114 26122 26141
## [1177] 26162 26174 26177 26179 26184 26190 26195 26199 26208 26209 26218 26219
## [1189] 26223 26229 26239 26253 26256 26268 26271 26283 26290 26298 26305 26316
## [1201] 26323 26330 26332 26333 26335 26338 26359 26361 26371 26376 26379 26380
## [1213] 26387 26389 26396 26398 26405 26409 26419 26420 26423 26427 26437 26443
## [1225] 26444 26448 26451 26475 26481 26504 26506 26508 26512 26517 26523 26527
## [1237] 26532 26543 26554 26557 26561 26568 26569 26572 26575 26578 26583 26594
## [1249] 26595 26599 26602 26633 26637 26638 26646 26677 26684 26690 26693 26696
## [1261] 26700 26701 26707 26709 26714 26727 26729 26732 26733 26738 26741 26754
## [1273] 26762 26775 26776 26780 26782 26784 26785 26792 26797 26803 26814 26840
## [1285] 26843 26855 26856 26867 26870 26884 26886 26888 26916 26917 26923 26932
## [1297] 26933 26943 26952 26955 26960 26968 26969 26974 26979 26989 26991 26994
## [1309] 26997 27003 27015 27016 27017 27031 27046 27060 27063 27065 27067 27077
## [1321] 27078 27079 27080 27086 27090 27091 27119 27126 27127 27137 27152 27164
## [1333] 27167 27173 27177 27185 27187 27193 27196 27200 27204 27205 27224 27228
## [1345] 27229 27239 27245 27252 27260 27263 27274 27292 27300 27304 27306 27315
## [1357] 27317 27325 27326 27327 27328 27329 27330 27339 27352 27354 27375 27385
## [1369] 27392 27395 27401 27410 27418 27420 27423 27424 27425 27430 27432 27435
## [1381] 27438 27449 27458 27460 27461 27462 27490 27495 27496 27498 27512 27522
## [1393] 27530 27543 27546 27548 27550 27553 27554 27559 27563 27565 27571 27574
## [1405] 27576 27585 27586 27591 27596 27599 27602 27606 27611 27613 27621 27633
## [1417] 27635 27636 27638 27639 27643 27653 27655 27658 27659 27671 27673 27674
## [1429] 27676 27681 27682 27690 27698 27702 27704 27707 27710 27713 27716 27724
## [1441] 27726 27728 27731 27737 27738 27750 27753 27754 27757 27758 27763 27765
## [1453] 27767 27792 27801 27805 27807 27821 27828 27833 27834 27839 27845 27851
# All 1464 Class 4 prisoners are considered outliers because there are so few of them.
#Plot
stripchart(FinalProjectData[,21], method = "stack")
#Mean
mean_class_X <- mean(FinalProjectData[,22])
mean_class_X
## [1] 0.3501849
#Standard Deviation
sd_class_X <- sd(FinalProjectData[,22])
sd_class_X
## [1] 0.4770363
#Sample Variance
var_class_X <- var(FinalProjectData[,22])
var_class_X
## [1] 0.2275636
#Skewness
skew_class_X <- skewness(FinalProjectData[,22])
skew_class_X
## [1] 0.628119
#Kurtosis
kurt_class_X <- kurtosis(FinalProjectData[,22])
kurt_class_X
## [1] 1.394533
#1D Outliers
which(abs(scale(FinalProjectData[,22]))>3)
## integer(0)
#Plot
stripchart(FinalProjectData[,22], method = "stack")
#Mean
mean_murder <- mean(FinalProjectData[,23])
mean_murder
## [1] 0.2230082
#Standard Deviation
sd_murder <- sd(FinalProjectData[,23])
sd_murder
## [1] 0.4162712
#Sample Variance
var_murder <- var(FinalProjectData[,23])
var_murder
## [1] 0.1732817
#Skewness
skew_murder <- skewness(FinalProjectData[,23])
skew_murder
## [1] 1.330848
#Kurtosis
kurt_murder <- kurtosis(FinalProjectData[,23])
kurt_murder
## [1] 2.771156
#1D Outliers
which(abs(scale(FinalProjectData[,23]))>3)
## integer(0)
#Plot
stripchart(FinalProjectData[,23], method = "stack")
#Mean
meanpersoncrimes <- mean(FinalProjectData[,24])
meanpersoncrimes
## [1] 0.6104987
#Standard Deviation
sdpersoncrimes <- sd(FinalProjectData[,24])
sdpersoncrimes
## [1] 0.4876459
#Sample Variance
varpersoncrimes <- var(FinalProjectData[,24])
varpersoncrimes
## [1] 0.2377986
#Skewness
skewpersoncrimes <- skewness(FinalProjectData[,24])
skewpersoncrimes
## [1] -0.4532006
#Kurtosis
kurtpersoncrimes <- kurtosis(FinalProjectData[,24])
kurtpersoncrimes
## [1] 1.205391
#1D Outliers
which(abs(scale(FinalProjectData[,24]))>3)
## integer(0)
#Plot
stripchart(FinalProjectData[,24], method = "stack")
#Mean
meansexcrimes <- mean(FinalProjectData[,25])
meansexcrimes
## [1] 0.1804962
#Standard Deviation
sdsexcrimes <- sd(FinalProjectData[,25])
sdsexcrimes
## [1] 0.3846071
#Sample Variance
varsexcrimes <- var(FinalProjectData[,25])
varsexcrimes
## [1] 0.1479226
#Skewness
skewsexcrimes <- skewness(FinalProjectData[,25])
skewsexcrimes
## [1] 1.661485
#Kurtosis
kurtsexcrimes <- kurtosis(FinalProjectData[,25])
kurtsexcrimes
## [1] 3.760533
#1D Outliers
which(abs(scale(FinalProjectData[,25]))>3)
## integer(0)
#Plot
stripchart(FinalProjectData[,25], method = "stack")
#Mean
meandrugcrimes <- mean(FinalProjectData[,26])
meandrugcrimes
## [1] 0.112671
#Standard Deviation
sddrugcrimes <- sd(FinalProjectData[,26])
sddrugcrimes
## [1] 0.3161959
#Sample Variance
vardrugcrimes <- var(FinalProjectData[,26])
vardrugcrimes
## [1] 0.09997983
#Skewness
skewdrugcrimes <- skewness(FinalProjectData[,26])
skewdrugcrimes
## [1] 2.449975
#Kurtosis
kurtdrugcrimes <- kurtosis(FinalProjectData[,26])
kurtdrugcrimes
## [1] 7.002376
#1D Outliers
which(abs(scale(FinalProjectData[,26]))>3)
## integer(0)
#Plot
stripchart(FinalProjectData[,26], method = "stack")
#Mean
meanpropcrimes <- mean(FinalProjectData[,27])
meanpropcrimes
## [1] 0.09019425
#Standard Deviation
sdpropcrimes <- sd(FinalProjectData[,27])
sdpropcrimes
## [1] 0.286465
#Sample Variance
varpropcrimes <- var(FinalProjectData[,27])
varpropcrimes
## [1] 0.08206219
#Skewness
skewpropcrimes <- skewness(FinalProjectData[,27])
skewpropcrimes
## [1] 2.861174
#Kurtosis
kurtpropcrimes <- kurtosis(FinalProjectData[,27])
kurtpropcrimes
## [1] 9.186317
#1D Outliers
which(abs(scale(FinalProjectData[,27]))>3)
## [1] 30 70 93 94 130 138 144 165 166 177 207 208
## [13] 211 222 242 260 286 288 306 328 360 367 369 370
## [25] 382 384 387 389 392 393 435 441 451 452 468 476
## [37] 478 501 511 512 513 516 529 536 541 546 554 562
## [49] 579 583 589 592 605 608 622 629 637 655 657 658
## [61] 671 672 682 695 702 705 710 712 715 721 727 750
## [73] 753 761 791 807 822 831 833 846 859 872 885 912
## [85] 928 941 947 954 972 978 980 982 988 993 999 1002
## [97] 1008 1019 1028 1037 1058 1059 1076 1079 1082 1089 1093 1113
## [109] 1128 1139 1160 1161 1169 1208 1218 1221 1225 1227 1232 1243
## [121] 1255 1259 1283 1298 1303 1304 1307 1309 1321 1328 1330 1332
## [133] 1351 1361 1372 1375 1377 1405 1406 1410 1413 1414 1415 1416
## [145] 1423 1461 1462 1474 1482 1493 1494 1497 1519 1528 1534 1536
## [157] 1537 1555 1556 1559 1571 1588 1607 1618 1619 1630 1642 1645
## [169] 1649 1650 1669 1696 1698 1754 1771 1784 1789 1811 1824 1826
## [181] 1827 1833 1858 1861 1865 1867 1868 1878 1880 1912 1913 1914
## [193] 1922 1923 1924 1925 1928 1962 1977 1981 2010 2015 2024 2052
## [205] 2064 2069 2070 2082 2104 2107 2116 2141 2152 2171 2174 2178
## [217] 2217 2233 2247 2254 2256 2270 2275 2285 2298 2318 2322 2355
## [229] 2369 2397 2400 2409 2453 2456 2472 2473 2478 2489 2529 2578
## [241] 2589 2600 2609 2632 2653 2675 2680 2682 2684 2692 2693 2704
## [253] 2719 2735 2750 2757 2760 2766 2783 2788 2790 2803 2826 2828
## [265] 2883 2884 2891 2918 2941 2943 2978 2980 2981 2984 2986 2987
## [277] 2990 2996 2997 3010 3015 3035 3036 3038 3040 3041 3048 3050
## [289] 3061 3065 3066 3067 3070 3078 3080 3092 3108 3109 3111 3132
## [301] 3133 3141 3159 3164 3165 3169 3172 3174 3182 3190 3192 3201
## [313] 3230 3251 3256 3289 3296 3314 3318 3323 3325 3339 3352 3357
## [325] 3370 3383 3392 3398 3399 3410 3417 3421 3427 3428 3429 3431
## [337] 3439 3462 3475 3476 3485 3486 3489 3506 3515 3520 3529 3534
## [349] 3540 3548 3559 3560 3561 3572 3574 3608 3609 3610 3614 3617
## [361] 3644 3654 3684 3696 3708 3713 3717 3727 3729 3732 3740 3741
## [373] 3746 3749 3763 3777 3786 3817 3865 3870 3876 3887 3890 3894
## [385] 3898 3899 3900 3903 3939 3940 3944 3947 3948 3950 3955 3958
## [397] 3963 3974 3988 4040 4044 4045 4055 4058 4068 4078 4084 4108
## [409] 4124 4158 4179 4183 4194 4207 4254 4299 4314 4317 4325 4336
## [421] 4349 4360 4365 4380 4402 4404 4407 4411 4414 4430 4442 4446
## [433] 4466 4489 4490 4501 4512 4691 4712 4714 4719 4765 4767 4793
## [445] 4802 4813 4817 4818 4834 4870 4874 4878 4911 4914 4920 4934
## [457] 4940 4949 4961 4963 4988 4989 5104 5108 5111 5113 5125 5161
## [469] 5194 5198 5200 5209 5218 5235 5241 5243 5249 5266 5271 5279
## [481] 5291 5295 5304 5345 5355 5367 5420 5452 5461 5472 5492 5539
## [493] 5546 5559 5570 5593 5596 5612 5620 5624 5626 5638 5642 5645
## [505] 5661 5668 5683 5698 5704 5708 5717 5738 5747 5761 5765 5766
## [517] 5773 5777 5781 5785 5787 5791 5817 5825 5831 5832 5838 5849
## [529] 5854 5861 5870 5871 5874 5878 5887 5899 5900 5906 5910 5919
## [541] 5939 5949 5953 5979 5981 5999 6017 6026 6035 6047 6065 6072
## [553] 6079 6081 6085 6088 6114 6117 6120 6133 6134 6148 6149 6154
## [565] 6161 6163 6164 6177 6178 6193 6199 6210 6231 6235 6242 6264
## [577] 6267 6270 6275 6277 6288 6297 6298 6300 6303 6305 6336 6337
## [589] 6364 6367 6368 6372 6377 6391 6408 6410 6449 6453 6485 6512
## [601] 6532 6556 6570 6595 6607 6619 6632 6636 6646 6654 6685 6698
## [613] 6708 6711 6720 6726 6751 6780 6819 6824 6844 6850 6854 6877
## [625] 6878 6880 6882 6890 6894 6896 6898 6903 6918 6931 6938 6946
## [637] 6953 6990 7045 7066 7074 7119 7146 7163 7174 7189 7191 7225
## [649] 7244 7249 7281 7282 7292 7311 7318 7325 7354 7391 7440 7467
## [661] 7474 7486 7496 7501 7546 7549 7579 7589 7601 7610 7629 7635
## [673] 7640 7660 7663 7667 7670 7686 7687 7688 7692 7711 7720 7755
## [685] 7764 7782 7805 7808 7819 7844 7856 7933 7937 7966 7978 8009
## [697] 8027 8048 8072 8097 8106 8137 8147 8169 8203 8208 8216 8240
## [709] 8268 8272 8275 8278 8283 8285 8288 8297 8302 8310 8328 8348
## [721] 8354 8366 8370 8421 8459 8481 8482 8489 8491 8498 8520 8539
## [733] 8557 8566 8587 8626 8638 8647 8653 8682 8689 8723 8744 8767
## [745] 8779 8780 8789 8825 8840 8878 8913 8928 8933 8934 8945 8959
## [757] 8964 8975 8976 8994 9004 9034 9041 9057 9069 9105 9109 9117
## [769] 9128 9149 9181 9188 9198 9213 9219 9222 9234 9236 9246 9247
## [781] 9249 9305 9327 9330 9361 9384 9385 9386 9418 9425 9455 9460
## [793] 9469 9479 9485 9494 9496 9499 9515 9519 9531 9547 9548 9583
## [805] 9585 9647 9691 9768 9781 9789 9798 9799 9805 9814 9822 9865
## [817] 9936 9944 9991 9998 10037 10059 10074 10080 10115 10135 10142 10178
## [829] 10188 10193 10203 10206 10216 10218 10222 10226 10245 10259 10272 10296
## [841] 10310 10355 10363 10373 10392 10401 10406 10431 10450 10460 10467 10514
## [853] 10515 10517 10519 10527 10528 10530 10540 10545 10558 10571 10593 10603
## [865] 10632 10660 10672 10684 10686 10733 10736 10761 10829 10847 10864 10888
## [877] 10892 10893 10906 10964 10975 11036 11053 11084 11085 11121 11123 11139
## [889] 11162 11190 11194 11198 11207 11260 11262 11283 11291 11299 11303 11325
## [901] 11326 11327 11330 11347 11369 11380 11400 11426 11436 11473 11495 11501
## [913] 11517 11533 11534 11552 11564 11566 11576 11579 11580 11583 11593 11599
## [925] 11603 11604 11616 11652 11653 11654 11670 11683 11696 11697 11704 11714
## [937] 11718 11728 11746 11755 11757 11760 11782 11787 11789 11791 11799 11810
## [949] 11842 11849 11858 11875 11878 11886 11910 11922 11932 11934 11955 11956
## [961] 11965 11983 11985 11990 11999 12002 12008 12014 12028 12032 12053 12067
## [973] 12077 12079 12088 12095 12097 12101 12116 12120 12121 12126 12131 12144
## [985] 12172 12181 12196 12205 12219 12221 12222 12225 12229 12259 12294 12303
## [997] 12321 12327 12352 12360 12366 12383 12392 12408 12409 12430 12454 12456
## [1009] 12467 12470 12471 12472 12474 12480 12481 12484 12487 12496 12533 12554
## [1021] 12557 12558 12574 12577 12587 12594 12615 12617 12631 12636 12658 12659
## [1033] 12671 12692 12693 12698 12708 12712 12734 12747 12751 12765 12769 12793
## [1045] 12829 12883 12907 12916 12926 12954 12968 12985 12986 12996 13008 13027
## [1057] 13037 13122 13128 13153 13181 13183 13217 13237 13238 13240 13241 13296
## [1069] 13307 13337 13346 13358 13373 13376 13377 13389 13392 13403 13444 13446
## [1081] 13456 13464 13476 13487 13506 13516 13543 13546 13552 13567 13578 13580
## [1093] 13597 13626 13632 13650 13653 13677 13697 13736 13773 13774 13780 13781
## [1105] 13795 13810 13850 13851 13868 13876 13881 13955 13956 13963 13969 13987
## [1117] 13990 14023 14033 14046 14064 14085 14087 14149 14160 14179 14200 14214
## [1129] 14223 14231 14235 14237 14245 14250 14251 14265 14269 14303 14322 14328
## [1141] 14333 14334 14339 14377 14386 14391 14397 14405 14411 14416 14418 14421
## [1153] 14426 14427 14438 14441 14462 14467 14474 14479 14484 14485 14513 14526
## [1165] 14540 14543 14553 14578 14587 14589 14607 14615 14624 14646 14711 14718
## [1177] 14723 14726 14761 14767 14770 14787 14789 14795 14797 14800 14820 14846
## [1189] 14877 14878 14884 14896 14897 14917 14930 14950 14951 14977 14987 14998
## [1201] 15015 15031 15056 15061 15064 15067 15069 15091 15100 15125 15127 15145
## [1213] 15151 15152 15172 15202 15213 15232 15261 15293 15296 15302 15316 15326
## [1225] 15374 15379 15380 15398 15400 15408 15422 15437 15457 15463 15478 15485
## [1237] 15532 15536 15562 15573 15597 15612 15628 15641 15670 15671 15678 15685
## [1249] 15691 15699 15701 15752 15760 15797 15801 15838 15863 15876 15895 15908
## [1261] 15913 15921 15930 15940 15972 15976 16006 16015 16026 16068 16070 16075
## [1273] 16120 16128 16144 16210 16251 16266 16272 16284 16309 16310 16326 16355
## [1285] 16374 16375 16379 16383 16403 16410 16423 16447 16521 16523 16531 16535
## [1297] 16542 16552 16569 16580 16587 16590 16609 16610 16625 16708 16743 16833
## [1309] 16846 16868 16874 16876 16877 16889 16894 16917 16918 16925 16934 16948
## [1321] 16967 16995 16999 17001 17022 17037 17072 17075 17080 17111 17116 17125
## [1333] 17126 17128 17134 17147 17153 17163 17167 17176 17179 17194 17206 17213
## [1345] 17217 17223 17238 17245 17262 17278 17287 17294 17298 17299 17316 17329
## [1357] 17331 17363 17368 17372 17383 17395 17398 17403 17411 17419 17421 17423
## [1369] 17432 17434 17436 17448 17449 17455 17457 17459 17483 17492 17512 17513
## [1381] 17514 17519 17522 17534 17555 17557 17563 17566 17567 17593 17608 17620
## [1393] 17636 17661 17674 17679 17687 17703 17705 17709 17711 17723 17753 17756
## [1405] 17758 17760 17774 17779 17781 17782 17799 17813 17819 17820 17825 17832
## [1417] 17837 17838 17844 17854 17855 17871 17884 17906 17909 17916 17918 17924
## [1429] 17941 17947 17969 17978 18003 18015 18018 18025 18032 18034 18035 18059
## [1441] 18061 18073 18078 18082 18095 18101 18104 18118 18121 18137 18150 18160
## [1453] 18163 18168 18191 18201 18209 18212 18224 18228 18229 18231 18240 18244
## [1465] 18253 18261 18264 18267 18270 18271 18278 18288 18296 18301 18305 18309
## [1477] 18311 18318 18336 18337 18339 18346 18348 18353 18356 18361 18362 18367
## [1489] 18373 18385 18387 18392 18397 18418 18422 18429 18448 18456 18460 18461
## [1501] 18465 18468 18476 18502 18525 18526 18530 18542 18543 18547 18559 18573
## [1513] 18575 18587 18594 18603 18604 18607 18610 18612 18614 18647 18662 18664
## [1525] 18666 18671 18678 18682 18683 18686 18691 18704 18709 18710 18714 18716
## [1537] 18724 18730 18734 18736 18741 18743 18748 18751 18752 18763 18766 18782
## [1549] 18816 18822 18823 18831 18833 18836 18837 18839 18841 18854 18870 18877
## [1561] 18881 18889 18893 18902 18917 18919 18927 18931 18938 18951 18962 18969
## [1573] 18970 18981 18982 18987 18996 19001 19029 19036 19084 19089 19109 19111
## [1585] 19116 19124 19125 19169 19200 19216 19218 19231 19237 19243 19251 19268
## [1597] 19276 19283 19288 19289 19309 19310 19325 19362 19374 19409 19422 19445
## [1609] 19462 19467 19500 19502 19508 19523 19537 19560 19574 19581 19584 19591
## [1621] 19595 19633 19638 19656 19664 19665 19668 19684 19691 19697 19710 19737
## [1633] 19764 19768 19782 19783 19786 19793 19798 19818 19822 19832 19845 19847
## [1645] 19849 19868 19885 19891 19894 19899 19905 19914 19945 19998 20025 20031
## [1657] 20035 20055 20061 20077 20081 20092 20097 20124 20136 20145 20146 20153
## [1669] 20165 20185 20194 20197 20217 20223 20269 20271 20297 20304 20311 20337
## [1681] 20380 20402 20409 20423 20428 20441 20462 20484 20523 20544 20550 20555
## [1693] 20583 20586 20618 20650 20660 20666 20680 20701 20747 20776 20782 20795
## [1705] 20803 20806 20808 20824 20825 20828 20845 20865 20871 20891 20907 20913
## [1717] 20920 20928 20982 21005 21012 21013 21036 21039 21042 21067 21077 21089
## [1729] 21093 21112 21113 21126 21129 21169 21179 21210 21218 21241 21247 21251
## [1741] 21255 21256 21263 21269 21296 21297 21332 21358 21360 21368 21379 21386
## [1753] 21395 21396 21427 21432 21491 21513 21519 21533 21534 21540 21553 21581
## [1765] 21590 21595 21600 21603 21653 21669 21680 21691 21697 21724 21735 21740
## [1777] 21800 21830 21847 21861 21872 21880 21888 21892 21906 21911 21915 21916
## [1789] 21917 21923 21924 21931 21932 21934 21945 21955 21977 21982 21986 22003
## [1801] 22019 22029 22035 22037 22043 22045 22056 22057 22065 22068 22078 22085
## [1813] 22092 22111 22124 22126 22178 22186 22220 22235 22236 22280 22289 22302
## [1825] 22347 22353 22362 22365 22377 22383 22394 22462 22465 22470 22495 22517
## [1837] 22523 22550 22564 22590 22600 22618 22633 22637 22639 22642 22648 22654
## [1849] 22655 22657 22661 22700 22706 22711 22721 22734 22736 22749 22760 22801
## [1861] 22840 22845 22848 22871 22878 22885 22888 22889 22900 22913 22918 22926
## [1873] 22931 22935 22945 22968 22974 22989 23036 23051 23061 23066 23084 23092
## [1885] 23112 23176 23188 23216 23229 23247 23258 23264 23306 23316 23322 23345
## [1897] 23370 23371 23373 23377 23413 23421 23440 23442 23502 23508 23511 23542
## [1909] 23544 23554 23555 23558 23561 23562 23580 23604 23610 23613 23620 23643
## [1921] 23666 23667 23673 23685 23687 23705 23708 23709 23711 23738 23741 23768
## [1933] 23794 23798 23826 23857 23862 23879 23886 23889 23899 23920 23926 23930
## [1945] 23952 23962 23970 23971 23981 23986 23992 23995 23998 24010 24011 24014
## [1957] 24035 24040 24046 24049 24058 24065 24069 24079 24090 24091 24095 24103
## [1969] 24104 24111 24119 24132 24135 24140 24198 24203 24207 24210 24211 24216
## [1981] 24218 24229 24232 24234 24236 24258 24264 24269 24272 24275 24291 24306
## [1993] 24311 24314 24328 24355 24360 24376 24379 24391 24396 24401 24415 24422
## [2005] 24434 24436 24449 24458 24469 24471 24474 24480 24482 24489 24494 24497
## [2017] 24511 24523 24526 24531 24535 24536 24541 24550 24551 24553 24558 24561
## [2029] 24562 24563 24565 24578 24588 24594 24602 24605 24611 24627 24630 24642
## [2041] 24655 24679 24683 24700 24703 24704 24720 24725 24730 24733 24762 24763
## [2053] 24764 24770 24771 24774 24777 24783 24788 24795 24797 24804 24839 24844
## [2065] 24845 24846 24848 24855 24858 24866 24870 24883 24889 24897 24900 24901
## [2077] 24914 24915 24916 24918 24922 24927 24928 24929 24937 24939 24949 24950
## [2089] 24951 24969 24970 24984 25000 25005 25028 25035 25042 25043 25044 25048
## [2101] 25057 25059 25060 25067 25070 25075 25077 25080 25088 25106 25107 25112
## [2113] 25114 25116 25122 25128 25138 25142 25143 25144 25155 25162 25169 25171
## [2125] 25174 25181 25182 25186 25190 25192 25200 25208 25221 25229 25257 25261
## [2137] 25262 25269 25271 25273 25279 25289 25290 25307 25309 25324 25333 25339
## [2149] 25344 25371 25391 25398 25402 25406 25413 25451 25458 25464 25466 25467
## [2161] 25485 25488 25501 25505 25512 25516 25518 25525 25533 25542 25545 25553
## [2173] 25557 25568 25574 25578 25591 25592 25595 25599 25600 25601 25613 25622
## [2185] 25624 25626 25637 25639 25643 25649 25661 25683 25691 25693 25705 25716
## [2197] 25723 25726 25731 25739 25740 25742 25744 25747 25750 25751 25764 25774
## [2209] 25784 25785 25795 25800 25811 25814 25818 25832 25836 25840 25844 25846
## [2221] 25854 25857 25858 25862 25864 25872 25877 25891 25899 25900 25902 25907
## [2233] 25910 25921 25923 25927 25928 25936 25938 25940 25949 25952 25959 25960
## [2245] 25961 25966 25970 25980 25989 25994 25998 26002 26029 26040 26049 26058
## [2257] 26067 26068 26070 26071 26081 26091 26098 26110 26115 26118 26142 26152
## [2269] 26158 26159 26163 26175 26177 26188 26191 26200 26203 26222 26223 26248
## [2281] 26250 26255 26263 26268 26286 26287 26290 26323 26325 26331 26334 26335
## [2293] 26345 26349 26352 26357 26358 26374 26378 26400 26403 26406 26412 26422
## [2305] 26426 26437 26439 26459 26468 26482 26483 26497 26503 26509 26514 26525
## [2317] 26526 26527 26530 26535 26551 26553 26556 26560 26565 26568 26570 26571
## [2329] 26602 26613 26615 26618 26624 26643 26655 26658 26673 26676 26677 26683
## [2341] 26685 26695 26698 26701 26718 26728 26735 26736 26737 26738 26739 26745
## [2353] 26752 26761 26765 26773 26786 26788 26790 26797 26799 26806 26808 26810
## [2365] 26824 26831 26838 26842 26850 26863 26866 26881 26883 26884 26901 26917
## [2377] 26923 26931 26935 26944 26947 26956 26960 26965 26968 26969 26973 26986
## [2389] 26994 27011 27027 27032 27035 27036 27046 27050 27077 27079 27080 27085
## [2401] 27094 27100 27114 27117 27129 27130 27138 27153 27158 27164 27173 27177
## [2413] 27182 27183 27204 27223 27229 27230 27238 27249 27250 27279 27280 27281
## [2425] 27284 27287 27289 27290 27293 27301 27304 27305 27314 27326 27333 27334
## [2437] 27337 27352 27358 27359 27362 27363 27364 27391 27396 27418 27421 27425
## [2449] 27427 27428 27432 27447 27450 27453 27469 27480 27481 27487 27489 27501
## [2461] 27503 27505 27508 27512 27523 27528 27530 27537 27556 27560 27561 27567
## [2473] 27568 27589 27598 27604 27618 27619 27628 27633 27653 27662 27673 27675
## [2485] 27677 27682 27708 27709 27720 27723 27736 27738 27740 27750 27751 27755
## [2497] 27760 27768 27772 27774 27778 27782 27787 27790 27792 27793 27798 27815
## [2509] 27816 27823 27844 27851
# All 2512 property crimes are considered outliers because there are so few of them.
#Plot
stripchart(FinalProjectData[,27], method = "stack")
#Mean
meanlifesentence <- mean(FinalProjectData[,28])
meanlifesentence
## [1] 0.05378622
#Standard Deviation
sdlifesentence <- sd(FinalProjectData[,28])
sdlifesentence
## [1] 0.2255994
#Sample Variance
varlifesentence <- var(FinalProjectData[,28])
varlifesentence
## [1] 0.05089509
#Skewness
skewlifesentence <- skewness(FinalProjectData[,28])
skewlifesentence
## [1] 3.955877
#Kurtosis
kurtlifesentence <- kurtosis(FinalProjectData[,28])
kurtlifesentence
## [1] 16.64897
#1D Outliers
which(abs(scale(FinalProjectData[,28]))>3)
## [1] 3 4 5 6 8 10 11 13 14 16 17 18
## [13] 22 23 24 27 29 31 32 33 34 37 38 39
## [25] 40 41 45 46 47 48 49 52 53 56 58 60
## [37] 61 62 63 64 65 66 67 68 69 71 72 73
## [49] 75 77 79 80 81 82 83 85 87 88 89 90
## [61] 92 96 97 99 101 102 105 107 108 109 111 112
## [73] 113 115 116 117 119 121 122 125 127 128 129 131
## [85] 132 140 141 142 143 145 146 147 150 152 154 155
## [97] 160 163 167 170 171 172 173 174 176 179 181 184
## [109] 187 193 196 197 198 200 201 202 204 205 206 209
## [121] 212 214 218 221 228 229 232 239 240 244 247 248
## [133] 250 252 256 257 258 263 264 265 266 268 272 273
## [145] 277 278 279 280 281 282 284 285 289 291 292 293
## [157] 295 298 308 311 312 313 315 316 317 318 319 323
## [169] 324 325 327 329 330 331 336 337 339 340 342 344
## [181] 348 349 354 356 357 359 361 363 373 374 376 377
## [193] 381 386 391 395 401 405 411 414 426 432 434 437
## [205] 446 449 454 479 485 494 496 500 505 507 508 514
## [217] 518 522 523 539 544 550 557 563 581 594 596 607
## [229] 609 610 612 613 615 618 619 628 630 631 634 635
## [241] 636 641 643 656 667 674 676 688 697 731 741 752
## [253] 755 760 766 788 794 799 803 806 808 811 812 813
## [265] 816 818 829 835 836 838 839 848 858 863 874 878
## [277] 886 902 911 914 925 931 936 940 944 962 964 968
## [289] 975 987 989 1013 1015 1021 1030 1036 1038 1042 1043 1049
## [301] 1054 1055 1057 1069 1071 1072 1073 1106 1116 1117 1123 1138
## [313] 1141 1143 1197 1199 1207 1211 1214 1216 1219 1220 1222 1224
## [325] 1229 1237 1238 1252 1266 1268 1310 1347 1371 1373 1393 1397
## [337] 1398 1400 1412 1420 1424 1432 1433 1440 1454 1464 1479 1480
## [349] 1485 1489 1495 1503 1508 1517 1523 1529 1531 1544 1548 1561
## [361] 1566 1575 1577 1579 1580 1585 1589 1596 1602 1604 1610 1615
## [373] 1622 1624 1626 1639 1648 1663 1667 1668 1670 1684 1687 1694
## [385] 1695 1707 1708 1716 1722 1728 1729 1732 1741 1743 1765 1776
## [397] 1778 1788 1790 1794 1803 1814 1819 1821 1828 1832 1850 1852
## [409] 1855 1856 1873 1883 1887 1889 1892 1893 1894 1906 1916 1920
## [421] 1921 1930 1932 1934 1937 1947 1948 1949 1955 1960 1963 1964
## [433] 1967 1970 1971 1972 1979 1990 1993 2001 2012 2016 2020 2022
## [445] 2023 2035 2039 2043 2044 2048 2050 2077 2078 2088 2092 2095
## [457] 2097 2129 2143 2147 2154 2166 2187 2190 2194 2203 2205 2223
## [469] 2243 2258 2259 2260 2267 2268 2284 2290 2299 2308 2314 2315
## [481] 2317 2319 2320 2329 2332 2338 2347 2352 2353 2364 2372 2386
## [493] 2387 2388 2398 2405 2423 2429 2449 2463 2487 2500 2514 2517
## [505] 2525 2526 2527 2528 2544 2551 2557 2562 2563 2564 2567 2577
## [517] 2596 2598 2603 2604 2611 2612 2618 2621 2636 2674 2685 2709
## [529] 2711 2714 2728 2731 2747 2754 2772 2780 2789 2793 2799 2805
## [541] 2819 2822 2830 2836 2840 2854 2859 2860 2861 2888 2889 2902
## [553] 2908 2921 2924 2925 2933 2946 2961 2962 2966 2976 2979 2983
## [565] 2989 2994 3005 3016 3020 3043 3052 3073 3076 3077 3095 3097
## [577] 3099 3103 3114 3143 3147 3177 3270 3275 3358 3367 3368 3369
## [589] 3450 3526 3705 3787 3820 3832 3864 3869 3893 3917 3925 4008
## [601] 4013 4017 4020 4038 4041 4048 4051 4059 4071 4119 4125 4131
## [613] 4143 4147 4150 4160 4161 4168 4186 4202 4208 4214 4215 4225
## [625] 4227 4228 4236 4248 4250 4263 4269 4279 4304 4315 4344 4355
## [637] 4381 4386 4391 4433 4437 4439 4441 4465 4467 4471 4473 4483
## [649] 4491 4493 4521 4522 4553 4555 4564 4577 4578 4585 4589 4600
## [661] 4629 4635 4640 4653 4656 4672 4674 4675 4678 4698 4718 4722
## [673] 4730 4733 4746 4766 4772 4773 4779 4781 4786 4792 4806 4808
## [685] 4822 4823 4832 4835 4837 4840 4849 4857 4865 4890 4893 4926
## [697] 4941 4950 4959 4967 4971 4977 5008 5022 5024 5048 5049 5063
## [709] 5066 5082 5088 5089 5094 5099 5117 5122 5155 5156 5160 5162
## [721] 5166 5167 5176 5185 5202 5205 5216 5261 5265 5287 5302 5303
## [733] 5312 5322 5352 5353 5363 5369 5384 5404 5411 5432 5440 5442
## [745] 5459 5478 5511 5553 5556 5561 5568 5573 5586 5606 5610 5630
## [757] 5634 5640 5716 5731 5732 5743 5753 5841 5848 5877 5897 5935
## [769] 5978 5985 6024 6029 6037 6151 6160 6165 6168 6186 6222 6340
## [781] 6352 6495 6539 6578 6588 6597 6599 6659 6665 6806 6840 6947
## [793] 6969 7023 7046 7121 7351 7363 7455 7480 7528 7673 7884 7896
## [805] 7941 7948 7969 7987 8117 8173 8179 8461 8463 8515 8593 8625
## [817] 8645 8719 8730 8750 8827 8837 8880 8916 8948 9045 9084 9177
## [829] 9196 9293 9299 9328 9448 9640 9704 9713 9733 9916 9949 10007
## [841] 10077 10094 10113 10131 10208 10289 10348 10409 10420 10589 10596 10743
## [853] 10819 10842 10891 10916 11037 11192 11193 11201 11206 11209 11212 11214
## [865] 11216 11220 11221 11223 11226 11227 11231 11232 11233 11235 11239 11241
## [877] 11242 11244 11248 11250 11252 11255 11256 11258 11267 11269 11270 11272
## [889] 11273 11274 11278 11280 11284 11287 11294 11297 11302 11308 11310 11312
## [901] 11313 11314 11317 11322 11328 11329 11331 11332 11333 11334 11335 11336
## [913] 11340 11341 11342 11343 11344 11346 11349 11351 11352 11356 11357 11358
## [925] 11360 11361 11362 11364 11372 11373 11377 11378 11379 11381 11382 11384
## [937] 11392 11397 11408 11410 11412 11418 11423 11424 11425 11429 11431 11432
## [949] 11433 11434 11435 11440 11442 11446 11447 11452 11454 11455 11458 11460
## [961] 11466 11468 11472 11475 11477 11479 11480 11481 11482 11490 11491 11496
## [973] 11497 11499 11500 11510 11514 11518 11523 11526 11529 11532 11537 11540
## [985] 11544 11545 11555 11567 11569 11570 11571 11573 11585 11587 11600 11607
## [997] 11610 11611 11618 11623 11625 11627 11629 11632 11634 11635 11637 11642
## [1009] 11644 11658 11659 11661 11665 11668 11671 11673 11675 11676 11677 11679
## [1021] 11685 11686 11687 11692 11693 11694 11700 11701 11702 11703 11705 11709
## [1033] 11713 11715 11733 11736 11737 11738 11743 11745 11750 11751 11752 11759
## [1045] 11761 11770 11771 11773 11774 11781 11783 11784 11790 11796 11798 11803
## [1057] 11805 11806 11809 11813 11815 11816 11821 11822 11823 11824 11826 11830
## [1069] 11833 11835 11836 11837 11838 11847 11848 11853 11860 11862 11863 11866
## [1081] 11873 11877 11880 11884 11887 11888 11889 11890 11892 11894 11895 11897
## [1093] 11900 11905 11908 11915 11918 11920 11921 11925 11927 11928 11929 11935
## [1105] 11938 11950 11951 11953 11954 11961 11963 11967 11969 11972 11991 11992
## [1117] 12003 12007 12009 12017 12018 12021 12024 12033 12049 12051 12056 12057
## [1129] 12060 12063 12073 12084 12085 12086 12089 12090 12093 12094 12096 12100
## [1141] 12103 12104 12105 12107 12118 12119 12123 12124 12132 12141 12148 12155
## [1153] 12157 12159 12163 12164 12166 12169 12170 12171 12173 12174 12184 12188
## [1165] 12197 12198 12210 12217 12220 12234 12236 12241 12246 12247 12252 12260
## [1177] 12262 12269 12270 12271 12272 12283 12284 12286 12288 12289 12296 12306
## [1189] 12310 12314 12315 12316 12319 12325 12339 12343 12345 12348 12349 12351
## [1201] 12353 12359 12370 12371 12373 12377 12380 12381 12382 12390 12400 12401
## [1213] 12404 12411 12414 12422 12424 12425 12426 12427 12429 12431 12436 12441
## [1225] 12448 12458 12459 12461 12462 12476 12478 12483 12486 12488 12493 12501
## [1237] 12508 12514 12515 12521 12529 12537 12539 12544 12546 12552 12553 12560
## [1249] 12566 12567 12572 12581 12582 12583 12584 12593 12599 12602 12621 12626
## [1261] 12635 12637 12642 12644 12645 12646 12653 12654 12657 12665 12667 12670
## [1273] 12672 12684 12686 12697 12702 12710 12714 12721 12723 12758 12777 12851
## [1285] 12935 12972 13025 13038 13051 13073 13092 13142 13198 13204 13220 13234
## [1297] 13272 13274 13283 13284 13303 13305 13340 13450 13454 13472 13482 13486
## [1309] 13495 13520 13523 13545 13560 13581 13587 13590 13700 13753 13786 13801
## [1321] 13816 13846 13849 13853 13859 13878 13888 13891 13902 13931 13977 14025
## [1333] 14058 14078 14118 14151 14184 14189 14197 14254 14271 14284 14295 14395
## [1345] 14413 14450 14466 14512 14538 14571 14574 14602 14615 14719 14722 14756
## [1357] 14816 14902 14907 14921 14947 14954 14973 14992 15021 15040 15133 15162
## [1369] 15230 15236 15255 15336 15432 15434 15488 15496 15497 15508 15541 15551
## [1381] 15558 15593 15619 15646 15854 15859 15887 15994 16041 16047 16104 16184
## [1393] 16188 16237 16294 16295 16352 16368 16415 16465 16469 16487 16526 16617
## [1405] 16630 16669 16691 16702 16727 16730 16737 16749 16771 16893 17007 17110
## [1417] 17117 17169 17170 17189 17192 17280 17282 17293 17300 17393 17438 17695
## [1429] 17722 17741 17772 17835 17940 17954 17984 18116 18199 18280 18389 18469
## [1441] 18589 18657 18673 18762 18774 19007 19012 19052 19108 19145 19258 19327
## [1453] 19423 19430 19520 19703 19725 19757 19839 19872 19873 20200 20289 20299
## [1465] 20432 20449 20467 20563 20673 20717 20843 21167 21217 21428 21499 21618
## [1477] 21706 21707 21883 22018 22213 22223 22229 22368 22544 22791 22798 22967
## [1489] 23118 23367 23757 24172 24243 24747 24775 25529 27180 27663
# All 1498 life sentences are considered outliers because there are so few of them.
#Plot
stripchart(FinalProjectData[,28], method = "stack")
#Mean
meansexdangper <- mean(FinalProjectData[,29])
meansexdangper
## [1] 0.005421708
#Standard Deviation
sdsexdangper <- sd(FinalProjectData[,29])
sdsexdangper
## [1] 0.07343369
#Sample Variance
varsexdangper <- var(FinalProjectData[,29])
varsexdangper
## [1] 0.005392507
#Skewness
skewsexdangper <- skewness(FinalProjectData[,29])
skewsexdangper
## [1] 13.47031
#Kurtosis
kurtsexdangper <- kurtosis(FinalProjectData[,29])
kurtsexdangper
## [1] 182.4492
#1D Outliers
which(abs(scale(FinalProjectData[,29]))>3)
## [1] 57 164 220 235 326 371 493 558 659 660 675 678
## [13] 775 845 853 883 1110 1122 1131 1153 1157 1241 1245 1258
## [25] 1281 1323 1343 1358 1399 1431 1656 1786 1839 1973 2146 2199
## [37] 2218 2770 3254 3432 3884 3891 3914 3954 3968 3999 4100 4149
## [49] 4353 4538 4562 4622 4991 5092 5196 5248 5493 5567 5584 5613
## [61] 5618 5662 5674 5689 5749 5798 5816 5858 5892 5947 6003 6006
## [73] 6012 6038 6086 6112 6116 7253 7866 8015 8909 11234 11275 11285
## [85] 11289 11321 11359 11390 11399 11401 11405 11493 11542 11549 11724 11804
## [97] 11807 11846 11852 11864 11899 11906 11919 11964 12029 12069 12098 12102
## [109] 12191 12275 12287 12300 12455 12490 12588 12639 12674 12676 12695 12756
## [121] 12780 12997 13180 13368 13694 14670 15601 15650 16182 16801 17494 17538
## [133] 17645 17649 17698 17786 17898 17950 17999 18049 18069 18287 18331 18343
## [145] 18447 18478 18755 18867 20573 20627 23731
# Approximately 150 sexually dangerous persons are considered outliers because there are so few of them.
#Plot
stripchart(FinalProjectData[,29], method = "stack")
#Mean
meansentenceyears <- mean(FinalProjectData[,30])
meansentenceyears
## [1] 24.19297
#Standard Deviation
sdsentenceyears <- sd(FinalProjectData[,30])
sdsentenceyears
## [1] 30.86298
#Sample Variance
varsentenceyears <- var(FinalProjectData[,30])
varsentenceyears
## [1] 952.5234
#Skewness
skewsentenceyears <- skewness(FinalProjectData[,30])
skewsentenceyears
## [1] 2.836815
#Kurtosis
kurtsentenceyears <- kurtosis(FinalProjectData[,30])
kurtsentenceyears
## [1] 19.29029
#1D Outliers
sentenceyearsoutliers <- which(abs(scale(FinalProjectData[,30]))>3)
sentenceyearsoutliers
## [1] 3 4 5 6 8 10 11 13 14 16 17 18
## [13] 22 23 24 27 29 31 32 33 34 37 38 39
## [25] 40 41 45 46 47 48 49 52 53 56 57 58
## [37] 60 61 62 63 64 65 66 67 68 69 71 72
## [49] 73 75 77 79 80 81 82 83 85 87 88 89
## [61] 90 92 96 97 99 101 102 105 107 108 109 111
## [73] 112 113 115 116 117 119 121 122 125 127 128 129
## [85] 131 132 140 141 142 143 145 146 147 150 152 154
## [97] 155 160 163 164 167 170 171 172 173 174 176 179
## [109] 181 184 187 193 196 197 198 200 201 202 204 205
## [121] 206 209 212 214 218 220 221 228 229 232 235 239
## [133] 240 244 247 248 250 252 256 257 258 263 264 265
## [145] 266 268 272 273 277 278 279 280 281 282 284 285
## [157] 289 291 292 293 295 298 308 311 312 313 315 316
## [169] 317 318 319 323 324 325 326 327 329 330 331 336
## [181] 337 339 340 342 344 348 349 354 356 357 359 361
## [193] 363 371 373 374 376 377 381 386 391 395 401 405
## [205] 411 414 426 432 434 437 446 449 454 479 485 493
## [217] 494 496 500 505 507 508 514 518 522 523 539 544
## [229] 550 557 558 563 581 594 596 607 609 610 612 613
## [241] 615 618 619 628 630 631 634 635 636 641 643 656
## [253] 659 660 667 674 675 676 678 688 697 731 741 752
## [265] 755 760 766 775 788 794 799 803 806 808 811 812
## [277] 813 816 818 829 835 836 838 839 845 848 853 858
## [289] 863 874 878 883 886 902 911 914 925 931 936 940
## [301] 944 962 964 968 975 987 989 1013 1015 1021 1030 1036
## [313] 1038 1042 1043 1049 1054 1055 1057 1069 1071 1072 1073 1106
## [325] 1110 1116 1117 1122 1123 1131 1138 1141 1143 1153 1157 1197
## [337] 1199 1207 1211 1214 1216 1219 1220 1222 1224 1229 1237 1238
## [349] 1241 1245 1252 1258 1266 1268 1281 1310 1323 1343 1347 1358
## [361] 1371 1373 1393 1397 1398 1399 1400 1412 1420 1424 1431 1432
## [373] 1433 1440 1454 1464 1479 1480 1485 1489 1495 1503 1508 1517
## [385] 1523 1529 1531 1544 1548 1561 1566 1575 1577 1579 1580 1585
## [397] 1589 1596 1602 1604 1610 1615 1622 1624 1626 1639 1648 1656
## [409] 1663 1667 1668 1670 1677 1684 1687 1694 1695 1707 1708 1716
## [421] 1722 1728 1729 1732 1741 1743 1765 1776 1778 1786 1788 1790
## [433] 1794 1803 1814 1819 1821 1828 1832 1839 1850 1852 1855 1856
## [445] 1873 1883 1887 1889 1892 1893 1894 1906 1916 1920 1921 1930
## [457] 1932 1934 1937 1947 1948 1949 1955 1960 1963 1964 1967 1970
## [469] 1971 1972 1973 1979 1990 1993 2001 2012 2016 2020 2022 2023
## [481] 2035 2039 2043 2044 2048 2050 2077 2078 2088 2092 2095 2097
## [493] 2129 2143 2146 2147 2154 2166 2187 2190 2194 2199 2203 2205
## [505] 2218 2223 2243 2258 2259 2260 2267 2268 2284 2290 2299 2308
## [517] 2314 2315 2317 2319 2320 2329 2332 2338 2347 2352 2353 2364
## [529] 2372 2386 2387 2388 2398 2405 2423 2429 2449 2463 2487 2500
## [541] 2514 2517 2525 2526 2527 2528 2544 2551 2557 2562 2563 2564
## [553] 2567 2577 2596 2598 2603 2604 2611 2612 2618 2621 2636 2674
## [565] 2685 2709 2711 2714 2728 2731 2747 2754 2770 2772 2780 2789
## [577] 2793 2799 2805 2819 2822 2830 2836 2840 2854 2859 2860 2861
## [589] 2888 2889 2902 2908 2921 2924 2925 2933 2946 2961 2962 2966
## [601] 2976 2979 2983 2989 2994 3005 3016 3020 3043 3052 3073 3076
## [613] 3077 3095 3097 3099 3103 3114 3143 3147 3177 3254 3270 3275
## [625] 3358 3367 3368 3369 3432 3450 3526 3705 3787 3819 3820 3821
## [637] 3823 3824 3825 3826 3828 3829 3830 3831 3832 3833 3834 3835
## [649] 3836 3837 3839 3840 3841 3842 3843 3844 3845 3846 3848 3849
## [661] 3852 3853 3854 3855 3856 3857 3858 3859 3861 3864 3869 3884
## [673] 3891 3893 3914 3917 3925 3954 3968 3999 4008 4013 4017 4020
## [685] 4038 4041 4048 4051 4059 4071 4100 4119 4125 4131 4143 4147
## [697] 4149 4150 4160 4161 4168 4186 4202 4208 4214 4215 4225 4227
## [709] 4228 4236 4248 4250 4263 4269 4279 4304 4315 4344 4353 4355
## [721] 4381 4386 4391 4433 4437 4439 4441 4465 4467 4471 4473 4483
## [733] 4491 4493 4521 4522 4538 4553 4555 4562 4564 4577 4578 4585
## [745] 4589 4600 4622 4629 4635 4640 4653 4656 4672 4674 4675 4678
## [757] 4698 4718 4722 4730 4733 4746 4766 4772 4773 4779 4781 4786
## [769] 4792 4806 4808 4822 4823 4832 4835 4837 4840 4849 4857 4865
## [781] 4890 4893 4926 4941 4950 4959 4967 4971 4977 4991 5008 5022
## [793] 5024 5048 5049 5063 5066 5082 5088 5089 5092 5094 5099 5117
## [805] 5122 5155 5156 5160 5162 5166 5167 5176 5185 5196 5202 5205
## [817] 5216 5248 5261 5265 5287 5302 5303 5312 5322 5352 5353 5363
## [829] 5369 5384 5404 5411 5432 5440 5442 5459 5478 5493 5511 5553
## [841] 5556 5561 5567 5568 5573 5584 5586 5606 5610 5613 5618 5630
## [853] 5634 5640 5662 5674 5689 5716 5731 5732 5743 5749 5753 5798
## [865] 5816 5841 5848 5858 5877 5892 5897 5935 5947 5978 5985 6003
## [877] 6006 6012 6024 6029 6037 6038 6086 6112 6116 6139 6140 6151
## [889] 6160 6165 6168 6186 6222 6340 6352 6495 6539 6578 6588 6597
## [901] 6599 6659 6665 6806 6840 6947 6969 7023 7046 7121 7253 7351
## [913] 7363 7455 7480 7528 7673 7866 7884 7896 7941 7948 7969 7987
## [925] 8015 8117 8173 8179 8461 8463 8515 8593 8625 8645 8719 8730
## [937] 8750 8827 8837 8880 8909 8916 8948 9045 9084 9177 9196 9293
## [949] 9299 9328 9448 9640 9704 9713 9733 9916 9949 10007 10077 10094
## [961] 10113 10131 10208 10289 10348 10409 10420 10589 10596 10743 10819 10842
## [973] 10891 10916 11037 11192 11193 11201 11206 11209 11212 11214 11216 11220
## [985] 11221 11223 11226 11227 11231 11232 11233 11234 11235 11239 11241 11242
## [997] 11244 11248 11250 11252 11255 11256 11258 11267 11269 11270 11272 11273
## [1009] 11274 11275 11278 11280 11284 11285 11287 11289 11294 11297 11302 11308
## [1021] 11310 11312 11313 11314 11317 11321 11322 11328 11329 11331 11332 11333
## [1033] 11334 11335 11336 11340 11341 11342 11343 11344 11346 11349 11351 11352
## [1045] 11356 11357 11358 11359 11360 11361 11362 11364 11372 11373 11377 11378
## [1057] 11379 11381 11382 11384 11390 11392 11397 11399 11401 11405 11408 11410
## [1069] 11412 11418 11423 11424 11425 11429 11431 11432 11433 11434 11435 11440
## [1081] 11442 11446 11447 11452 11454 11455 11458 11460 11466 11468 11472 11475
## [1093] 11477 11479 11480 11481 11482 11490 11491 11493 11496 11497 11499 11500
## [1105] 11510 11514 11518 11523 11526 11529 11532 11537 11540 11542 11544 11545
## [1117] 11549 11555 11567 11569 11570 11571 11573 11585 11587 11600 11607 11610
## [1129] 11611 11618 11623 11625 11627 11629 11632 11634 11635 11637 11642 11644
## [1141] 11658 11659 11661 11665 11668 11671 11673 11675 11676 11677 11679 11685
## [1153] 11686 11687 11692 11693 11694 11700 11701 11702 11703 11705 11709 11713
## [1165] 11715 11724 11733 11736 11737 11738 11743 11745 11750 11751 11752 11759
## [1177] 11761 11770 11771 11773 11774 11781 11783 11784 11790 11796 11798 11803
## [1189] 11804 11805 11806 11807 11809 11813 11815 11816 11821 11822 11823 11824
## [1201] 11826 11830 11833 11835 11836 11837 11838 11846 11847 11848 11852 11853
## [1213] 11860 11862 11863 11864 11866 11873 11877 11880 11884 11887 11888 11889
## [1225] 11890 11892 11894 11895 11897 11899 11900 11905 11906 11908 11915 11918
## [1237] 11919 11920 11921 11925 11927 11928 11929 11935 11938 11950 11951 11953
## [1249] 11954 11961 11963 11964 11967 11969 11972 11991 11992 12003 12007 12009
## [1261] 12017 12018 12021 12024 12029 12033 12049 12051 12056 12057 12060 12063
## [1273] 12069 12073 12084 12085 12086 12089 12090 12093 12094 12096 12098 12100
## [1285] 12102 12103 12104 12105 12107 12118 12119 12123 12124 12132 12141 12148
## [1297] 12155 12157 12159 12163 12164 12166 12169 12170 12171 12173 12174 12184
## [1309] 12188 12191 12197 12198 12210 12217 12220 12234 12236 12241 12246 12247
## [1321] 12252 12260 12262 12269 12270 12271 12272 12275 12283 12284 12286 12287
## [1333] 12288 12289 12296 12300 12306 12310 12314 12315 12316 12319 12325 12339
## [1345] 12343 12345 12348 12349 12351 12353 12359 12370 12371 12373 12377 12380
## [1357] 12381 12382 12390 12400 12401 12404 12411 12414 12422 12424 12425 12426
## [1369] 12427 12429 12431 12436 12441 12448 12455 12458 12459 12461 12462 12476
## [1381] 12478 12483 12486 12488 12490 12493 12501 12508 12514 12515 12521 12529
## [1393] 12537 12539 12544 12546 12552 12553 12560 12566 12567 12572 12581 12582
## [1405] 12583 12584 12588 12593 12599 12602 12621 12626 12635 12637 12639 12642
## [1417] 12644 12645 12646 12653 12654 12657 12665 12667 12670 12672 12674 12676
## [1429] 12684 12686 12695 12697 12702 12710 12714 12721 12723 12756 12758 12777
## [1441] 12780 12851 12935 12972 12997 13025 13038 13051 13073 13092 13142 13180
## [1453] 13198 13204 13220 13234 13272 13274 13283 13284 13303 13305 13340 13368
## [1465] 13450 13454 13472 13482 13486 13495 13520 13523 13545 13560 13581 13587
## [1477] 13590 13694 13700 13753 13786 13801 13816 13846 13849 13853 13859 13878
## [1489] 13888 13891 13902 13931 13977 14025 14058 14078 14118 14151 14184 14189
## [1501] 14197 14254 14271 14284 14295 14395 14413 14450 14466 14512 14538 14571
## [1513] 14574 14602 14615 14670 14719 14722 14756 14816 14902 14907 14921 14947
## [1525] 14954 14973 14992 15021 15040 15133 15162 15230 15236 15255 15336 15432
## [1537] 15434 15488 15496 15497 15508 15541 15551 15558 15593 15601 15619 15646
## [1549] 15650 15854 15859 15887 15994 16041 16047 16104 16182 16184 16188 16237
## [1561] 16294 16295 16352 16368 16415 16465 16469 16487 16526 16617 16630 16669
## [1573] 16691 16702 16727 16730 16737 16749 16771 16801 16893 17007 17110 17117
## [1585] 17169 17170 17189 17192 17280 17282 17293 17300 17393 17438 17494 17538
## [1597] 17645 17649 17695 17698 17722 17741 17772 17786 17835 17898 17940 17950
## [1609] 17954 17984 17999 18049 18069 18116 18199 18280 18287 18331 18343 18389
## [1621] 18447 18469 18478 18589 18657 18673 18755 18762 18774 18867 18990 19007
## [1633] 19012 19052 19108 19145 19258 19327 19423 19430 19520 19703 19725 19757
## [1645] 19839 19872 19873 20200 20289 20299 20432 20449 20467 20563 20573 20627
## [1657] 20673 20717 20843 21167 21217 21428 21499 21618 21706 21707 21883 22018
## [1669] 22213 22223 22229 22368 22544 22791 22798 22967 23118 23367 23731 23757
## [1681] 24172 24243 24747 24775 25529 27180 27663
#Mean without Outliers
meansentenceyears <- mean(FinalProjectData[-sentenceyearsoutliers,30])
meansentenceyears
## [1] 17.84251
#Standard Deviation without Outliers
sdsentenceyears <- sd(FinalProjectData[-sentenceyearsoutliers,30])
sdsentenceyears
## [1] 17.58807
#Sample Variance without Outliers
varsentenceyears <- var(FinalProjectData[-sentenceyearsoutliers,30])
varsentenceyears
## [1] 309.3401
#Skewness without Outliers
skewsentenceyears <- skewness(FinalProjectData[-sentenceyearsoutliers,30])
skewsentenceyears
## [1] 1.713896
#Kurtosis without Outliers
kurtsentenceyears <- kurtosis(FinalProjectData[-sentenceyearsoutliers,30])
kurtsentenceyears
## [1] 5.864075
#Plot without Outliers
stripchart(FinalProjectData[-sentenceyearsoutliers,30], method = "stack")
# The sentence years outliers seem to be influential in terms of changing the statistics and will be monitored when doing future analysis to determine the extent of their impact.
#Mean
mean_100 <- mean(FinalProjectData[,31])
mean_100
## [1] 0.1624717
#Standard Deviation
sd_100 <- sd(FinalProjectData[,31])
sd_100
## [1] 0.3688896
#Sample Variance
var_100 <- var(FinalProjectData[,31])
var_100
## [1] 0.1360795
#Skewness
skew_100 <- skewness(FinalProjectData[,31])
skew_100
## [1] 1.830002
#Kurtosis
kurt_100 <- kurtosis(FinalProjectData[,31])
kurt_100
## [1] 4.348907
#1D Outliers
which(abs(scale(FinalProjectData[,31]))>3)
## integer(0)
#Plot
stripchart(FinalProjectData[,31], method = "stack")
#Mean
mean_85 <- mean(FinalProjectData[,32])
mean_85
## [1] 0.3031848
#Standard Deviation
sd_85 <- sd(FinalProjectData[,32])
sd_85
## [1] 0.4596426
#Sample Variance
var_85 <- var(FinalProjectData[,32])
var_85
## [1] 0.2112714
#Skewness
skew_85 <- skewness(FinalProjectData[,32])
skew_85
## [1] 0.8563989
#Kurtosis
kurt_85 <- kurtosis(FinalProjectData[,32])
kurt_85
## [1] 1.733419
#1D Outliers
which(abs(scale(FinalProjectData[,32]))>3)
## integer(0)
#Plot
stripchart(FinalProjectData[,32], method = "stack")
#Mean
mean_75 <- mean(FinalProjectData[,33])
mean_75
## [1] 0.01152562
#Standard Deviation
sd_75 <- sd(FinalProjectData[,33])
sd_75
## [1] 0.1067389
#Sample Variance
var_75 <- var(FinalProjectData[,33])
var_75
## [1] 0.01139319
#Skewness
skew_75<- skewness(FinalProjectData[,33])
skew_75
## [1] 9.152863
#Kurtosis
kurt_75 <- kurtosis(FinalProjectData[,33])
kurt_75
## [1] 84.7749
#1D Outliers
which(abs(scale(FinalProjectData[,33]))>3)
## [1] 473 482 489 1091 1150 1171 1179 1187 1265 1278 1577 1695
## [13] 2120 2134 2153 2215 2234 2324 2401 2457 2522 2843 2909 2970
## [25] 2975 3220 3248 3311 3603 3655 3810 3879 3909 3910 4007 4012
## [37] 4105 4210 4280 4392 4445 4617 4637 4739 4784 4938 5040 5313
## [49] 5338 5423 5482 5508 5571 5678 5688 5720 5739 5768 5788 5845
## [61] 5855 5996 6196 6203 6258 6428 6673 6710 6728 6777 6799 6933
## [73] 6981 6996 7088 7131 7259 7596 7621 7726 7853 7854 8013 8014
## [85] 8291 8521 8589 8636 8654 8756 8918 9035 9124 9223 9244 9752
## [97] 9858 9909 9965 9966 10006 10153 10210 10251 10287 10319 10334 10365
## [109] 10522 10598 10612 10681 10729 10895 11001 11075 11104 11144 11404 11590
## [121] 11817 12256 12313 12995 13088 13158 13160 13281 13308 13429 13479 13831
## [133] 14226 14785 14807 15086 15690 15729 16087 16239 16311 16342 16394 16492
## [145] 16929 17085 17131 17156 17181 17207 17241 17330 17396 17552 17578 17597
## [157] 17752 17766 17872 17979 18002 18115 18241 18255 18268 18275 18292 18493
## [169] 18506 18534 18538 18602 18605 18622 18697 18754 18779 18826 18891 18942
## [181] 18961 18979 19038 19057 19361 19454 19471 19519 19525 19532 19614 19641
## [193] 19663 19889 19921 19934 19968 19976 20006 20012 20096 20120 20122 20129
## [205] 20159 20162 20273 20284 20301 20302 20336 20357 20382 20505 20609 20635
## [217] 20636 20656 20774 20780 20848 20864 20887 20903 20963 21131 21416 21452
## [229] 21531 21577 21695 21736 21781 21794 21896 21907 22015 22024 22097 22098
## [241] 22259 22373 22410 22424 22443 22472 22596 22616 22653 22690 22720 22750
## [253] 22780 22826 22827 22991 23034 23049 23057 23076 23077 23139 23170 23234
## [265] 23383 23537 23577 23644 23670 23935 23947 23958 24097 24204 24219 24224
## [277] 24233 24259 24290 24294 24318 24321 24424 24425 24439 24462 24467 24491
## [289] 24552 24591 24601 24618 24685 24789 24813 24923 25079 25086 25468 25497
## [301] 25847 25965 25977 26033 26062 26252 26431 26457 26864 26903 27075 27107
## [313] 27151 27191 27307 27345 27347 27670 27814 27846 27847
# Approximately 350 75% prisoners are considered outliers because there are so few of them.
#Plot
stripchart(FinalProjectData[,33], method = "stack")
#Mean
meanage <- mean(FinalProjectData[,34], na.rm = TRUE)
meanage
## [1] 33.46836
#Standard Deviation
sdage <- sd(FinalProjectData[,34], na.rm = TRUE)
sdage
## [1] 10.92811
#Sample Variance
varage <- var(FinalProjectData[,34], na.rm = TRUE)
varage
## [1] 119.4235
#Skewness
skewage <- skewness(FinalProjectData[,34], na.rm = TRUE)
skewage
## [1] 0.9067517
#Kurtosis
kurtage <- kurtosis(FinalProjectData[,34], na.rm = TRUE)
kurtage
## [1] 3.43644
#1D Outliers
ageoutliers <- which(abs(scale(FinalProjectData[,34]))>3)
ageoutliers
## [1] 25 30 55 94 106 130 138 149 215 321 350 882
## [13] 2327 2395 2952 2965 3301 3471 3492 3722 3772 3861 4561 5660
## [25] 5704 5984 6236 6821 6917 7432 7875 7949 7979 8269 8912 9335
## [37] 9457 9520 9657 9663 10546 10902 11107 11207 11277 11293 11311 11327
## [49] 11359 11455 11617 11633 11647 11740 11749 12071 12352 12454 12465 12706
## [61] 13189 13886 14846 15131 15163 16072 16318 16433 16483 17037 17259 17786
## [73] 18551 18616 18780 18867 18933 19012 19074 19118 19329 19399 19405 19430
## [85] 19446 19540 19549 19551 19666 19703 19985 19990 20102 20116 20182 20260
## [97] 20313 20356 20388 20423 20629 20687 20741 20777 20993 21048 21182 21384
## [109] 21487 21678 21903 21928 21939 21966 22058 22072 22080 22159 22269 22322
## [121] 22400 22430 22521 22591 22802 22835 22906 22946 22955 23065 23199 23207
## [133] 23211 23282 23336 23359 23455 23488 23494 23553 23597 23615 23631 23637
## [145] 23677 23725 23759 23777 23836 23837 23845 23886 23966 23975 24013 24153
## [157] 24319 24375 24530 24603 24609 24697 24794 24879 25048 25357 25564 25581
## [169] 25648 25867 25892 25912 26019 26048 26062 26064 26138 26147 26477 26642
## [181] 26651 26653 26796 26885 26902 27088 27155 27222 27518 27545 27712 27751
#Mean without Outliers
meanage <- mean(FinalProjectData[-ageoutliers,34], na.rm = TRUE)
meanage
## [1] 33.20849
#Standard Deviation without Outliers
sdage <- sd(FinalProjectData[-ageoutliers,34], na.rm = TRUE)
sdage
## [1] 10.50487
#Sample Variance without Outliers
varage <- var(FinalProjectData[-ageoutliers,34], na.rm = TRUE)
varage
## [1] 110.3523
#Skewness without Outliers
skewage <- skewness(FinalProjectData[-ageoutliers,34], na.rm = TRUE)
skewage
## [1] 0.7774994
#Kurtosis without Outliers
kurtage <- kurtosis(FinalProjectData[-ageoutliers,34], na.rm = TRUE)
kurtage
## [1] 2.928613
#Plot without Outliers
stripchart(FinalProjectData[-ageoutliers,34], method = "stack")
# The age outliers do not appear to be influential since the key statistics do not change very much.
#Mean
meannw <- mean(FinalProjectData[,35])
meannw
## [1] 0.1314854
#Standard Deviation
sdnw <- sd(FinalProjectData[,35])
sdnw
## [1] 0.3379365
#Sample Variance
varnw <- var(FinalProjectData[,35])
varnw
## [1] 0.1142011
#Skewness
skewnw <- skewness(FinalProjectData[,35])
skewnw
## [1] 2.181008
#Kurtosis
kurtnw <- kurtosis(FinalProjectData[,35])
kurtnw
## [1] 5.756798
#1D Outliers
which(abs(scale(FinalProjectData[,35]))>3)
## integer(0)
#Plot
stripchart(FinalProjectData[,35], method = "stack")
#Mean
meansw <- mean(FinalProjectData[,36])
meansw
## [1] 0.1123119
#Standard Deviation
sdsw <- sd(FinalProjectData[,36])
sdsw
## [1] 0.3157555
#Sample Variance
varsw <- var(FinalProjectData[,36])
varsw
## [1] 0.09970155
#Skewness
skewsw <- skewness(FinalProjectData[,36])
skewsw
## [1] 2.455666
#Kurtosis
kurtsw <- kurtosis(FinalProjectData[,36])
kurtsw
## [1] 7.030294
#1D Outliers
which(abs(scale(FinalProjectData[,36]))>3)
## integer(0)
#Plot
stripchart(FinalProjectData[,36], method = "stack")
#Mean
meanne <- mean(FinalProjectData[,37])
meanne
## [1] 0.6520053
#Standard Deviation
sdne <- sd(FinalProjectData[,37])
sdne
## [1] 0.4763429
#Sample Variance
varne <- var(FinalProjectData[,37])
varne
## [1] 0.2269025
#Skewness
skewne <- skewness(FinalProjectData[,37])
skewne
## [1] -0.6382295
#Kurtosis
kurtne <- kurtosis(FinalProjectData[,37])
kurtne
## [1] 1.407337
#1D Outliers
which(abs(scale(FinalProjectData[,37]))>3)
## integer(0)
#Plot
stripchart(FinalProjectData[,37], method = "stack")
frame <- as.data.frame(FinalProjectData)
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.0.5
We looked at every plot between each dimension and sentence years, with sentence years as the predicted variable, since this is the variable we are interested in. Our more interesting observations are included below.
ggplot(frame, aes(x=frame[,1], y=frame[,30])) + xlab(colnames(frame)[1]) + ylab(colnames(frame)[30]) + geom_point() + geom_jitter()
men <- which(frame[,1] == 0)
women <- which(frame[,1] == 1)
mean(frame[men,30])
## [1] 24.49757
mean(frame[women,30])
## [1] 17.99176
sentenceYrs <- which(abs(scale(FinalProjectData[,30]))>3)
noMenOutliers <- intersect(sentenceYrs, men)
noWomenOutliers <- intersect(sentenceYrs, women)
mean(frame[-c(noMenOutliers,women),30])
## [1] 18.0265
mean(frame[-c(noWomenOutliers,men),30])
## [1] 14.20274
# Looking at sentence years for men versus women, women are more clustered at the bottom where men tend to spread up. The average mean sentence years for men is about 7.5 years higher than women. When we remove the outliers for sentence years, men's mean time served becomes 18 and women's becomes 14.2, so men still serve more time on average, but only by 4 years instead of 7.5.
ggplot(frame, aes(x=frame[,"PropertyCrimes"], y=frame[,30])) + xlab("PropertyCrimes") + ylab(colnames(frame)[30]) + geom_point()+geom_jitter()
ggplot(frame, aes(x=frame[,"DrugCrimes"], y=frame[,30])) + xlab("DrugCrimes") + ylab(colnames(frame)[30]) + geom_point()+geom_jitter()
ggplot(frame, aes(x=frame[,"SexCrimes"], y=frame[,30])) + xlab("SexCrimes") + ylab(colnames(frame)[30]) + geom_point()+geom_jitter()
ggplot(frame, aes(x=frame[,"PersonCrimes"], y=frame[,30])) + xlab("PersonCrimes") + ylab(colnames(frame)[30]) + geom_point()+geom_jitter()
#Property and drug crimes have the lowest sentence years on average, while person, and sex crimes have the highest sentence years on average.
mean(FinalProjectData[which(FinalProjectData[,"PropertyCrimes"]==1), "SentenceYears"])
## [1] 6.964703
mean(FinalProjectData[which(FinalProjectData[,"DrugCrimes"]==1), "SentenceYears"])
## [1] 7.947445
mean(FinalProjectData[which(FinalProjectData[,"PersonCrimes"]==1), "SentenceYears"])
## [1] 30.79542
mean(FinalProjectData[which(FinalProjectData[,"SexCrimes"]==1), "SentenceYears"])
## [1] 21.14091
class1 <- which(frame[,18] == 1)
class2 <- which(frame[,19] == 1)
class3 <- which(frame[,20] == 1)
class4 <- which(frame[,21] == 1)
classx <- which(frame[,22] == 1)
murder <- which(frame[,23] == 1)
mean(frame[class1,30])
## [1] 10.31765
mean(frame[class2,30])
## [1] 6.388391
mean(frame[class3,30])
## [1] 3.796722
mean(frame[class4,30])
## [1] 2.581113
mean(frame[classx,30])
## [1] 21.12687
mean(frame[murder,30])
## [1] 59.902
sentenceYrs <- which(abs(scale(FinalProjectData[,30]))>3)
class1Outliers <- intersect(sentenceYrs, class1)
class2Outliers <- intersect(sentenceYrs, class2)
class3Outliers <- intersect(sentenceYrs, class3)
class4Outliers <- intersect(sentenceYrs, class4)
classxOutliers <- intersect(sentenceYrs, classx)
murderOutliers <- intersect(sentenceYrs, murder)
newC1 <- setdiff(class1, class1Outliers)
newC2 <- setdiff(class2, class2Outliers)
newC3 <- setdiff(class3, class3Outliers)
newC4 <- setdiff(class4, class4Outliers)
newCx <- setdiff(classx, classxOutliers)
newMurder <- setdiff(murder, murderOutliers)
mean(frame[newC1,30])
## [1] 9.996758
mean(frame[newC2,30])
## [1] 6.364707
mean(frame[newC3,30])
## [1] 3.796722
mean(frame[newC4,30])
## [1] 2.581113
mean(frame[newCx,30])
## [1] 18.0197
mean(frame[newMurder,30])
## [1] 44.20368
# With the outliers still included, the mean sentence years served based on crime class varied widely, with class 4 having the lowest at an average of 2.6 years and murder having the highest at almost 60 years. When we remove the outliers, most averages don't change, but the biggest difference is classx drops by 3 years and murder drops by 15 years. Since classx and murder are the most severe crime classes, this could be because they are more prone to having extreme high values for sentence years rather than the other crime classes.
#The graphs aren't included here because they don't add anything. The summary above covers it.
####Bivariate Outliers
# We ran this to grab all of our outliers for future use. This finds all of our outliers, for each column. We didn't do any additional analysis from this because there are so many outliers since if an individual is an outlier in one column, they get added. This can be helpful in the future if we split it out by each column. Nearly 67% of our rows include at least one outlier in one of the dimensions.
library(stats)
newDataForOutliers <- FinalProjectData
multiOutlier <- function(j, outliers){
for(i in j:37){
if(i!=j){
m <- mahalanobis(x = newDataForOutliers[,c(j,i)],center = c(mean(newDataForOutliers[,j]), mean(newDataForOutliers[,i])),cov = cov(newDataForOutliers[,c(j,i)]))
indexes <- (m > 9.21034)
indexes <- which(indexes == TRUE)
outliers <- c(outliers, indexes)
}
}
return(outliers)
}
outliers <- c()
for(i in 1:37){
if(i != 14 & i != 15 & i != 34){
outliers <- c(outliers, multiOutlier(i, outliers))
outliers<- unique(outliers)
}
}
length(outliers)
## [1] 18675
length(outliers)/(length(newDataForOutliers)/37)
## [1] 0.6705325
library(corrplot)
## corrplot 0.92 loaded
R <- cor(FinalProjectData, use = "pairwise.complete.obs")
## Warning in cor(FinalProjectData, use = "pairwise.complete.obs"): the standard
## deviation is zero
corrplot(R, method = "color", tl.pos = 'n')
Less Obvious Correlations
-It appears that there is a strong positive correlation with murder and sentence years
-Positive correlation with murder and 100P
-Stronger negative correlation when between black and hispanic than white and hispanic
-Only moderately strong correlation between sex crimes and sexually dangerous person
-Low but positive correlation of black and hispanic in the northeast, negative for white
-Weak but positive correlation with sexually dangerous person and sentence years
-Positive correlation for murder and person crimes for sentence years, but negative for drug crimes and property crime
-Negative correlation between custody date (also sentence date) and murder
More Obvious Correlations
-Negative correlation between custody date and sentence date with murder.
-Negative correlations between Projected MSR date with life sentence and sentence years.
pairs(FinalProjectData[1:10,1:10], pch = 16, lower.panel = NULL)
pairs(FinalProjectData[1:10,10:20], pch = 16, lower.panel = NULL)
pairs(FinalProjectData[1:10,20:30], pch = 16, lower.panel = NULL)
pairs(FinalProjectData[1:10,30:37], pch = 16, lower.panel = NULL)
pairs(FinalProjectData[10:20,10:20], pch = 16, lower.panel = NULL)
pairs(FinalProjectData[10:20,20:30], pch = 16, lower.panel = NULL)
pairs(FinalProjectData[10:20,30:37], pch = 16, lower.panel = NULL)
pairs(FinalProjectData[20:30,20:30], pch = 16, lower.panel = NULL)
pairs(FinalProjectData[20:30,30:37], pch = 16, lower.panel = NULL)
pairs(FinalProjectData[30:37,30:37], pch = 16, lower.panel = NULL)