Contents

Are pubs the primal cause for crimes?

Contents

Let’s load the crimes data and look at the aggregated stats along with the distribution of criminals according to the region_name.

Now, let’s examine the density plots, scatterplots and correlation between public_houses and criminals.

Using the different variables available to us, let’s create multiple models starting from base model of using mean value. The t-stat of each variable included and the adjusted R-square parameters will help in decided the appropriate model for our usecase.

termestimatestd.errorstatisticp.valueconf.lowconf.high
(Intercept)1536.5523.31.57e-24140166
termestimatestd.errorstatisticp.valueconf.lowconf.high
(Intercept)109    14.8   7.416.9e-0979.5   139    
public_houses0.1160.03613.220.002630.04310.189
termestimatestd.errorstatisticp.valueconf.lowconf.high
(Intercept)173     35.8   4.82 2.57e-05100     246     
public_houses0.123 0.035 3.52 0.00118 0.05230.194 
school_attendance-0.101 0.0441-2.3  0.0276  -0.19  -0.0118
worship_attendance0.03930.04130.9510.348   -0.04460.123 
termestimatestd.errorstatisticp.valueconf.lowconf.high
(Intercept)179     35.2   5.071.12e-05107     250      
public_houses0.126 0.03483.630.0008540.05580.197  
school_attendance-0.07650.0356-2.150.0381  -0.149 -0.00443

Let’s compare all these models to get a high level view on the best one.

Comparison of models
(1)(2)(3)(4)
(Intercept)152.900 109.340 172.886 178.813 
(6.549)(14.755)(35.839)(35.246)
public_houses     0.116 0.123 0.126 
     (0.036)(0.035)(0.035)
school_attendance          -0.101 -0.077 
          (0.044)(0.036)
worship_attendance          0.039      
          (0.041)     
#observations40     40     40     40     
R squared0.000 0.214 0.319 0.302 
Adj. R Squared0.000 0.194 0.262 0.264 
Residual SE41.416 37.193 35.583 35.536