Information

  • Author: Jose Carlos Molano de Oro

  • University: Pontificia Universidad Javeriana

  • Course: Linear Regression Analysis

  • Semester: 2022-3

  • Professor: Mario Gregorio Saavedra Rodriguez

  • Author Email: jose_molano@javeriana.edu.co

  • Professor Email: saavedrarmg@javeriana.edu.co

R Libraries

library(DT)
library(Hmisc)
library(reactablefmtr)
library(dplyr)
library(aplpack)
library(corrplot)
library(ggplot2)
library(MASS)
library(broom)
library(tidyverse)
library(ggfortify)
library(mosaic)
library(jtools)
library(latex2exp)
library(pubh)
library(sjlabelled)
library(sjPlot)
library(sjmisc)
library(Ecdat)
library(PerformanceAnalytics)
library(regclass)
library(pdp)
library(gridExtra)
library(olsrr)

FBI Arrest Data - Reported Number of Arrests by Crime

About the Dataset

This dataset contains the monthly number of reported arrests in the US for various offenses reported by participating law enforcement agencies. The arrests are by offense and broken down by age and sex or age and race. Not all agencies report race and/or ethnicity for arrests but they must report age and sex. Note that only agencies that have reported arrests for 12 months of the year are represented in the annual counts that are included in the database. Download this dataset to see totals of reported arrests for the nation from 1995–2016.

The dataset was taken from de Federal Bureo of Investigation (FBI) Crime Data Explorer

Data Curation

Initial Data Table

FBI<-read.csv(url("https://s3-us-gov-west-1.amazonaws.com/cg-d3f0433b-a53e-4934-8b94-c678aa2cbaf3/arrests_national.csv"),row.names = 2,h = T)

reactable(FBI,rownames = TRUE)

Since the id attribute is not used, it is removed from the dataset

FBI$id<-NULL
reactable(FBI,rownames = TRUE)

Dataset Summary

summary(FBI)
##    population        total_arrests         homicide          rape      
##  Min.   :262803276   Min.   :10662252   Min.   :10231   Min.   :16863  
##  1st Qu.:282395819   1st Qu.:12586911   1st Qu.:11348   1st Qu.:21701  
##  Median :297952772   Median :13839754   Median :13331   Median :25032  
##  Mean   :295487602   Mean   :13418226   Mean   :13710   Mean   :25205  
##  3rd Qu.:311023417   3rd Qu.:14180570   3rd Qu.:14134   3rd Qu.:28083  
##  Max.   :323127513   Max.   :15284300   Max.   :21230   Max.   :34650  
##     robbery       aggravated_assault    burglary         larceny       
##  Min.   : 94403   Min.   :358860     Min.   :207325   Min.   :1050058  
##  1st Qu.:105863   1st Qu.:400402     1st Qu.:288660   1st Qu.:1160498  
##  Median :108921   Median :442990     Median :295372   Median :1210490  
##  Mean   :116045   Mean   :445464     Mean   :294936   Mean   :1241126  
##  3rd Qu.:126438   3rd Qu.:478265     3rd Qu.:304564   3rd Qu.:1279616  
##  Max.   :171870   Max.   :568480     Max.   :386500   Max.   :1530200  
##  motor_vehicle_theft     arson       violent_crime    property_crime   
##  Min.   : 64566      Min.   : 8834   Min.   :480360   Min.   :1353283  
##  1st Qu.: 78934      1st Qu.:11519   1st Qu.:539047   1st Qu.:1606177  
##  Median :139978      Median :15834   Median :597236   Median :1630406  
##  Mean   :120921      Mean   :14733   Mean   :600415   Mean   :1671715  
##  3rd Qu.:148814      3rd Qu.:16759   3rd Qu.:626632   3rd Qu.:1677062  
##  Max.   :191900      Max.   :20000   Max.   :796250   Max.   :2128600  
##  other_assault        forgery           fraud         embezzlement  
##  Min.   :1078808   Min.   : 55333   Min.   :128531   Min.   :15200  
##  1st Qu.:1242966   1st Qu.: 72184   1st Qu.:173134   1st Qu.:16065  
##  Median :1293424   Median :107777   Median :281816   Median :17100  
##  Mean   :1259624   Mean   : 95762   Mean   :273572   Mean   :17620  
##  3rd Qu.:1310566   3rd Qu.:115451   3rd Qu.:343650   3rd Qu.:18852  
##  Max.   :1395800   Max.   :122300   Max.   :465000   Max.   :22381  
##  stolen_property    vandalism         weapons        prostitution   
##  Min.   : 88576   Min.   :191015   Min.   :137779   Min.   : 38306  
##  1st Qu.: 95519   1st Qu.:241417   1st Qu.:157338   1st Qu.: 58676  
##  Median :121936   Median :275064   Median :167153   Median : 78640  
##  Mean   :118191   Mean   :265275   Mean   :174857   Mean   : 74418  
##  3rd Qu.:128090   3rd Qu.:289934   3rd Qu.:190173   3rd Qu.: 87809  
##  Max.   :166500   Max.   :320900   Max.   :243900   Max.   :101600  
##  other_sex_offenses   drug_abuse         gambling     against_family  
##  Min.   : 51063     Min.   :1476100   Min.   : 3705   Min.   : 88748  
##  1st Qu.: 70076     1st Qu.:1533853   1st Qu.: 8900   1st Qu.:111938  
##  Median : 89082     Median :1576072   Median :10630   Median :127032  
##  Mean   : 81231     Mean   :1617127   Mean   :10736   Mean   :126231  
##  3rd Qu.: 93149     3rd Qu.:1674540   3rd Qu.:11916   3rd Qu.:143487  
##  Max.   :101900     Max.   :1889810   Max.   :21000   Max.   :155800  
##       dui           liquor_laws      drunkenness     disorderly_conduct
##  Min.   :1017808   Min.   :234899   Min.   :376433   Min.   :369733    
##  1st Qu.:1305198   1st Qu.:503684   1st Qu.:537818   1st Qu.:590412    
##  Median :1434117   Median :611335   Median :566726   Median :647346    
##  Mean   :1364988   Mean   :548852   Mean   :573149   Mean   :626903    
##  3rd Qu.:1461434   3rd Qu.:635714   3rd Qu.:632832   3rd Qu.:693571    
##  Max.   :1511300   Max.   :683124   Max.   :734800   Max.   :842600    
##     vagrancy         other           suspicion     curfew_loitering
##  Min.   :24851   Min.   :3218880   Min.   :  576   Min.   : 34176  
##  1st Qu.:27316   1st Qu.:3553687   1st Qu.: 1451   1st Qu.: 81406  
##  Median :29076   Median :3724251   Median : 3018   Median :139116  
##  Mean   :29909   Mean   :3668659   Mean   : 3909   Mean   :122666  
##  3rd Qu.:33056   3rd Qu.:3832337   3rd Qu.: 5562   3rd Qu.:152130  
##  Max.   :36471   Max.   :4022068   Max.   :12100   Max.   :187800

1. Aspects of Multivariate Analysis

FBI Arrest Data - Multivariate Data Description and Graphical Techniques

Mean

datatable(as.matrix(sapply(FBI,function(x) mean(x, na.rm=TRUE))))

Variance

reactable(var(FBI,use = "complete.obs"))

Covariance

reactable(cov(FBI,use = "complete.obs"))

Correlation

c=cor(FBI)
y=as.data.frame(c)
y[y==1]<-" "
y <- mutate_all(y, function(x) as.numeric(as.character(x)))


reactable(as.data.frame.array((y)),
defaultColDef = colDef(
style = highlight_min_max(as.data.frame.array((y)))))
Correlation Plot
corrplot(cor(FBI,use = "complete.obs"),method="circle")

Correlation Test: P-Values
FBI.rcorr = rcorr(as.matrix(FBI))
FBI.p=FBI.rcorr$P

reactable(as.data.frame.array(FBI.p),
          defaultColDef = colDef(
              style = highlight_min_max(as.data.frame.array(FBI.p))))
  • As can be seen in the correlation plot, it can be seen that almost all the variables are correlated with each other.

  • The values highlighted on the correlation matrix in green, represent the variables that are most correlated with each other.

  • The values highlighted on the correlation test table in green, represent the highest p-values of variables that are most correlated with each other. This p-values non-reject the nule hypothesis.

Graphic Representation

Considering the attributes in the correlation matrix that are most correlated positively with each other (values greater than 0.95):

  • aggravated_assault with violent_crime
  • violent_crime with homicide
  • violent_crime with stolen_property
  • aggravated_assault with fraud
  • fraud with arson
  • homicide with weapons
  • forgery with other_sex_offenses
  • prostitution with drunkeness
  • prostitution with curfew_loite_ring
  • drug_abuse with embezzlement
  • drug_abuse with vagrancy
  • dui with liquor_laws

Some of the mentioned attributes are taken to perform several graphs.

Scatter Plots
ggplot(FBI, aes(x=violent_crime, y=aggravated_assault)) + geom_point()+labs(title = "Violent Crime vs Aggravated Assault")

ggplot(FBI, aes(x=violent_crime, y=aggravated_assault,label=rownames(FBI))) + geom_text()+labs(title = "Violent Crime vs Aggravated Assault using Row Names")

ggplot(FBI, aes(x=violent_crime, y=homicide)) + geom_point()+labs(title = "Violent Crime vs Homicide")

ggplot(FBI, aes(x=violent_crime, y=homicide,label=rownames(FBI))) + geom_text()+labs(title = "Violent Crime vs Homicide using Row Names")

Bubble Charts
ggplot(FBI, aes(x=violent_crime, y=aggravated_assault,size=homicide)) + geom_point(alpha=0.5)+scale_size(range=c(.1,15))+labs(title = "Violent Crime vs Aggravated Assault and Homicide")

ggplot(FBI, aes(x=violent_crime, y=aggravated_assault,size=fraud)) + geom_point(alpha=0.5)+scale_size(range=c(.1,15))+labs(title = "Violent Crime vs Aggravated Assault and Fraud")

Chernoff Faces
df<-data.frame(FBI$aggravated_assault,FBI$violent_crime,FBI$homicide,FBI$stolen_property,FBI$fraud,FBI$arson,FBI$prostitution,FBI$other_sex_offenses,FBI$drunkenness,FBI$dui,FBI$liquor_laws,FBI$drug_abuse,FBI$curfew_loitering,FBI$embezzlement,FBI$vagrancy)

faces(df, main="United States FBI Arrest Data",face.type=0, print.info=TRUE,labels = rownames(FBI))

## effect of variables:
##  modified item       Var                     
##  "height of face   " "FBI.aggravated_assault"
##  "width of face    " "FBI.violent_crime"     
##  "structure of face" "FBI.homicide"          
##  "height of mouth  " "FBI.stolen_property"   
##  "width of mouth   " "FBI.fraud"             
##  "smiling          " "FBI.arson"             
##  "height of eyes   " "FBI.prostitution"      
##  "width of eyes    " "FBI.other_sex_offenses"
##  "height of hair   " "FBI.drunkenness"       
##  "width of hair   "  "FBI.dui"               
##  "style of hair   "  "FBI.liquor_laws"       
##  "height of nose  "  "FBI.drug_abuse"        
##  "width of nose   "  "FBI.curfew_loitering"  
##  "width of ear    "  "FBI.embezzlement"      
##  "height of ear   "  "FBI.vagrancy"

2. Data Training,Testing and Correlation)

Data Partition

FBI.train <- sample_frac(tbl = df, replace = FALSE, size = 0.80)
FBI.test <- anti_join(df, FBI.train)
## Joining, by = c("FBI.aggravated_assault", "FBI.violent_crime", "FBI.homicide",
## "FBI.stolen_property", "FBI.fraud", "FBI.arson", "FBI.prostitution",
## "FBI.other_sex_offenses", "FBI.drunkenness", "FBI.dui", "FBI.liquor_laws",
## "FBI.drug_abuse", "FBI.curfew_loitering", "FBI.embezzlement", "FBI.vagrancy")

Correlation Analysis

chart.Correlation(df)

3. Linear Model (aggravated_assault with FBI.violent_crime + FBI.homicide)

Data Adjust for Linear Model (aggravated_assault with FBI.violent_crime + FBI.homicide)

Lineal Model Diagnostic

model_norm <- lm(FBI.aggravated_assault ~ FBI.violent_crime + FBI.homicide, data = FBI.train)
autoplot(model_norm)

Summary

model_norm %>% augment() %>% as_tibble()
FBI.aggravated_assaultFBI.violent_crimeFBI.homicide.fitted.resid.hat.sigma.cooksd.std.resid
372685498666105713.71e+052.04e+030.203 9.17e+030.00565 0.258 
376154505681110923.75e+051.6e+03 0.231 9.18e+030.00424 0.206 
472290620510141584.6e+05 1.21e+040.07  8.56e+030.0505  1.42  
383977515151117883.8e+05 4.12e+030.302 9.1e+03 0.0444  0.555 
429969594911129554.43e+05-1.31e+040.08  8.43e+030.069   -1.54  
421215581765124184.34e+05-1.28e+040.09168.46e+030.0772  -1.52  
438033586558134674.34e+054.05e+030.07359.13e+030.00593 0.474 
408488552077112014.14e+05-5.11e+030.144 9.08e+030.0217  -0.622 
433945597447134804.43e+05-9.25e+030.05638.84e+030.0229  -1.07  
397707534704108324e+05       -2.57e+030.131 9.17e+030.00484 -0.31  
388362521196110753.88e+05541       0.128 9.19e+030.0002090.0652
447948611523134354.55e+05-7.4e+03 0.09718.96e+030.0276  -0.877 
449297603503140624.46e+053.25e+030.07759.15e+030.00405 0.38  
478417625132132274.68e+051.07e+040.259 8.58e+030.226   1.39  
534920717750182905.27e+058.37e+030.353 8.77e+030.249   1.17  
521570729900190205.34e+05-1.24e+040.47  7.98e+031.1     -1.92  
477809627132136534.68e+051e+04       0.166 8.71e+030.101   1.24  
449933597026131904.44e+055.95e+030.06569.05e+030.0112  0.693 

Model Coeficients

model_norm %>% tidy()
termestimatestd.errorstatisticp.value
(Intercept)-1.19e+042.99e+04-0.3980.696  
FBI.violent_crime0.851   0.115   7.4  2.2e-06
FBI.homicide-3.95    3.22    -1.23 0.238  

Confidence Intervals

model_norm %>% confint() %>% as_tibble()
2.5 %97.5 %
-7.56e+045.18e+04
0.606   1.1     
-10.8     2.91    

Model Plot

plot_model(model_norm,colors = "Accent", 
           show.values = TRUE,
           value.offset = .4,
           value.size = 4,
           dot.size = 3,
           line.size = 1.5,
           vline.color = "blue",
           width = 1.5
)

Model Multicollinearity

model_norm %>% VIF() %>% as_tibble()
value
11.8
11.8

Adjusted Model Residuals

p1 <- ggplot(FBI.train, aes(FBI.train[,2], residuals(model_norm))) +
    geom_point() + geom_smooth(color = "blue")
p2 <- ggplot(FBI.train, aes(FBI.train[,3], residuals(model_norm))) +
    geom_point() + geom_smooth(color = "blue")
p3 <- ggplot(FBI.train, aes(FBI.train[,10], residuals(model_norm))) +
    geom_point() + geom_smooth(color = "blue")
grid.arrange(p1, p2, p3)
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'

Outliers

model_norm %>% ols_plot_cooksd_bar()

Adjustment Model

model_norm %>%
  glm_coef(se_rob = TRUE, labels = model_labels(model_norm))
ParameterCoefficientPr(>|t|)
Constant-11887.45 (-71104.23, 47329.34)0.675
FBI.violent_crime0.85 (0.56, 1.14)< 0.001
FBI.homicide-3.95 (-13.81, 5.91)0.406

Adjustment Criteria Model

model_norm %>% glance()
r.squaredadj.r.squaredsigmastatisticp.valuedflogLikAICBICdeviancedf.residualnobs
0.9680.9648.88e+032305.58e-122-1883833871.18e+091518

Variance Analysis

model_norm %>% aov() %>% tidy()
termdfsumsqmeansqstatisticp.value
FBI.violent_crime13.62e+103.62e+10458   1.17e-12
FBI.homicide11.19e+081.19e+081.510.238   
Residuals151.18e+097.89e+07          

Criteria Comparison

model_norm_AIC <- stepAIC(model_norm, trace = 0)
AIC(model_norm, model_norm_AIC)
dfAIC
4383
3383

4. Linear Model (FBI.homicide with FBI.drug_abuse + FBI.violent_crime)

Data Adjust for Linear Model (FBI.homicide with FBI.drug_abuse + FBI.violent_crime)

Lineal Model Diagnostic

model_norm <- lm(FBI.homicide ~ FBI.drug_abuse + FBI.violent_crime, data = FBI.train)
autoplot(model_norm)

Summary

model_norm %>% augment() %>% as_tibble()
FBI.homicideFBI.drug_abuseFBI.violent_crime.fitted.resid.hat.sigma.cooksd.std.resid
1057115612314986661.02e+04403       0.188 7100.0319 0.642
1109214887075056811.05e+04596       0.228 6970.0936 0.975
1415815388136205101.44e+04-228       0.114 7170.00518-0.348
1178815725795151511.07e+041.07e+030.146 6510.157  1.66 
1295517025375949111.33e+04-355       0.07137130.00716-0.529
1241816635825817651.29e+04-486       0.05927080.0109 -0.72 
1346717465705865581.3e+04 497       0.102 7060.0216 0.754
1120116388465520771.19e+04-712       0.07626920.0311 -1.06 
1348018411825974471.32e+04249       0.216 7160.015  0.404
1083215312515347041.14e+04-612       0.137 6980.0473 -0.946
1107515524325211961.1e+04 121       0.144 7190.001990.188
1343518898106115231.37e+04-222       0.304 7170.0213 -0.382
1406218463516035031.34e+04629       0.225 6940.102  1.03 
1322715795666251321.45e+04-1.27e+030.09076260.122  -1.91 
1829015836007177501.77e+04613       0.312 6930.171  1.06 
1902015062007299001.82e+04833       0.435 6570.651  1.59 
1365315869026271321.46e+04-903       0.08926740.0604 -1.36 
1319016781925970261.34e+04-221       0.06187180.00237-0.329

Model Coeficients

model_norm %>% tidy()
termestimatestd.errorstatisticp.value
(Intercept)-5.12e+032.63e+03-1.95 0.0705  
FBI.drug_abuse-0.0012  0.00139 -0.8610.403   
FBI.violent_crime0.0344  0.00263 13.1  1.34e-09

Confidence Intervals

model_norm %>% confint() %>% as_tibble()
2.5 %97.5 %
-1.07e+04484      
-0.00416 0.00176
0.0288  0.04   

Model Plot

plot_model(model_norm,colors = "Accent", 
           show.values = TRUE,
           value.offset = .4,
           value.size = 4,
           dot.size = 3,
           line.size = 1.5,
           vline.color = "blue",
           width = 1.5
)

Model Multicollinearity

model_norm %>% VIF() %>% as_tibble()
value
1.01
1.01

Adjusted Model Residuals

p1 <- ggplot(FBI.train, aes(FBI.train[,2], residuals(model_norm))) +
    geom_point() + geom_smooth(color = "blue")
p2 <- ggplot(FBI.train, aes(FBI.train[,3], residuals(model_norm))) +
    geom_point() + geom_smooth(color = "blue")
p3 <- ggplot(FBI.train, aes(FBI.train[,10], residuals(model_norm))) +
    geom_point() + geom_smooth(color = "blue")
grid.arrange(p1, p2, p3)
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'

Outliers

model_norm %>% ols_plot_cooksd_bar()

Adjustment Model

model_norm %>%
  glm_coef(se_rob = TRUE, labels = model_labels(model_norm))
ParameterCoefficientPr(>|t|)
Constant-5115.68 (-10372.07, 140.7)0.056
FBI.drug_abuse0 (0, 0)0.43
FBI.violent_crime0.03 (0.03, 0.04)< 0.001

Adjustment Criteria Model

model_norm %>% glance()
r.squaredadj.r.squaredsigmastatisticp.valuedflogLikAICBICdeviancedf.residualnobs
0.9190.90969685.46.33e-092-1422912957.26e+061518

Variance Analysis

model_norm %>% aov() %>% tidy()
termdfsumsqmeansqstatisticp.value
FBI.drug_abuse11.09e+051.09e+050.2250.642   
FBI.violent_crime18.26e+078.26e+07171    1.34e-09
Residuals157.26e+064.84e+05           

Criteria Comparison

model_norm_AIC <- stepAIC(model_norm, trace = 0)
AIC(model_norm, model_norm_AIC)
dfAIC
4291
3290

5. Linear Model (FBI.homicide with FBI.prostitution + FBI.drug_abuse)

Data Adjust for Linear Model (FBI.homicide with FBI.prostitution + FBI.drug_abuse)

Lineal Model Diagnostic

model_norm <- lm(FBI.homicide ~ FBI.prostitution + FBI.drug_abuse, data = FBI.train)
autoplot(model_norm)

Summary

model_norm %>% augment() %>% as_tibble()
FBI.homicideFBI.prostitutionFBI.drug_abuse.fitted.resid.hat.sigma.cooksd.std.resid
105714759815612311.07e+04-148       0.167 1.24e+030.00122 -0.135
110924187714887071.04e+04687       0.253 1.23e+030.0494  0.661
141587973315388131.45e+04-374       0.123 1.24e+030.0052  -0.333
117883830615725799.59e+032.19e+030.261 1.04e+030.532   2.12 
129557500417025371.32e+04-252       0.07131.24e+030.00121 -0.217
124187135516635821.3e+04 -553       0.05891.23e+030.0047  -0.475
134678787217465701.45e+04-1.01e+030.122 1.21e+030.0375  -0.9  
112016266816388461.21e+04-886       0.07431.22e+030.0157  -0.767
134807760718411821.28e+04634       0.22  1.23e+030.0335  0.598
108325734515312511.2e+04 -1.15e+030.121 1.2e+03 0.0484  -1.02 
110755657515524321.18e+04-722       0.113 1.23e+030.0172  -0.637
134357967318898101.29e+04583       0.307 1.23e+030.0501  0.583
140628489118463511.37e+04401       0.226 1.24e+030.014   0.379
132278762015795661.52e+04-2.02e+030.132 1.1e+03 0.166   -1.81 
1829010160015836001.68e+041.45e+030.264 1.16e+030.237   1.41 
190209900015062001.69e+042.11e+030.335 1.03e+030.778   2.15 
136538085415869021.44e+04-779       0.08931.22e+030.0151  -0.68 
131907519016781921.33e+04-154       0.06171.24e+030.000384-0.132

Model Coeficients

model_norm %>% tidy()
termestimatestd.errorstatisticp.value
(Intercept)1.27e+043.92e+033.230.0056  
FBI.prostitution0.115   0.0168  6.875.28e-06
FBI.drug_abuse-0.00477 0.00251 -1.9 0.0772  

Confidence Intervals

model_norm %>% confint() %>% as_tibble()
2.5 %97.5 %
4.31e+032.1e+04 
0.0796  0.151   
-0.0101  0.000589

Model Plot

plot_model(model_norm,colors = "Accent", 
           show.values = TRUE,
           value.offset = .4,
           value.size = 4,
           dot.size = 3,
           line.size = 1.5,
           vline.color = "blue",
           width = 1.5
)

Model Multicollinearity

model_norm %>% VIF() %>% as_tibble()
value
1.11
1.11

Adjusted Model Residuals

p1 <- ggplot(FBI.train, aes(FBI.train[,2], residuals(model_norm))) +
    geom_point() + geom_smooth(color = "blue")
p2 <- ggplot(FBI.train, aes(FBI.train[,3], residuals(model_norm))) +
    geom_point() + geom_smooth(color = "blue")
p3 <- ggplot(FBI.train, aes(FBI.train[,10], residuals(model_norm))) +
    geom_point() + geom_smooth(color = "blue")
grid.arrange(p1, p2, p3)
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'

Outliers

model_norm %>% ols_plot_cooksd_bar()

Adjustment Model

model_norm %>%
  glm_coef(se_rob = TRUE, labels = model_labels(model_norm))
ParameterCoefficientPr(>|t|)
Constant12671.62 (3431.43, 21911.81)0.01 
FBI.prostitution0.12 (0.05, 0.18)0.002
FBI.drug_abuse0 (-0.01, 0)0.166

Adjustment Criteria Model

model_norm %>% glance()
r.squaredadj.r.squaredsigmastatisticp.valuedflogLikAICBICdeviancedf.residualnobs
0.7590.7271.2e+0323.72.29e-052-1523113152.17e+071518

Variance Analysis

model_norm %>% aov() %>% tidy()
termdfsumsqmeansqstatisticp.value
FBI.prostitution16.31e+076.31e+0743.78.25e-06
FBI.drug_abuse15.2e+06 5.2e+06 3.60.0772  
Residuals152.17e+071.44e+06         

Criteria Comparison

model_norm_AIC <- stepAIC(model_norm, trace = 0)
AIC(model_norm, model_norm_AIC)
dfAIC
4311
4311

6. References