Wolfram Computation Meets Knowledge

Urbana Police Traffic Stops

Urbana Police traffic stop motivation information from 2012 to September 2018

Police Traffic Stops. Each record records the information about a driver who was stopped, as captured for the Illinois Department of Transportation (IDOT) Traffic Stop program. In addition to the fields captured for IDOT, these records include the incident code recorded in the stop. Data goes back to 2012, when IDOT began using the current reporting layout.

Examples

Basic Examples

Retrieve the resource:

In[1]:=
ResourceObject["Urbana Police Traffic Stops"]
Out[1]=

Retrieve the default content:

In[2]:=
ResourceData["Urbana Police Traffic Stops"]
Out[2]=

Plot the average age of drivers stopped in each year:

In[3]:=
DateListPlot[{{First[First[#]]["Year"]}, N[Mean[Last /@ #]]} & /@ 
  Normal@(Values /@ GatherBy[
      ResourceData["Urbana Police Traffic Stops"][
        Select[#ResidencyCode == True && #CanineSearchConducted == 
            True &]][
       All, {"TrafficDate", "AgeAtContact"}], #TrafficDate[
        "Year"] &]), PlotRange -> All]
Out[3]=

Create a PieChart of the races of stopped drivers:

In[4]:=
With[{data = 
   Counts[ResourceData["Urbana Police Traffic Stops"][All, 
     "RaceDescription"]]},
 PieChart[data, ChartLegends -> Normal@Keys@data]]
Out[4]=

Plot the number of stops with a one month moving average:

In[5]:=
Module[{data = ResourceData["Urbana Police Traffic Stops"], stops, 
  means}, stops = 
  TimeSeries[Normal[Tally[data[[All, "TrafficDate"]]]]]; 
 means = MovingMap[Mean, stops, {1, "Month"}]; 
 DateListPlot[{stops, means}, PlotRange -> All]]
Out[5]=

Generate a BarChart of traffic stops grouped by the day of the week:

In[6]:=
Module[{byday = 
   SortBy[ Normal[
     Tally[DayName /@ 
       ResourceData["Urbana Police Traffic Stops"][All, 
        "TrafficDate"]]], Last]},
 BarChart[Last /@ byday, ChartLabels -> First /@ byday, 
  ImageSize -> Large]]
Out[6]=

Wolfram Research, "Urbana Police Traffic Stops" from the Wolfram Data Repository (2018) 

Data Resource History

Source Metadata

Publisher Information