After a thorough search of applicable data sets in “Ecdat” and “wooldridge”, I found the data set “prison” (https://rdrr.io/cran/wooldridge/man/prison.html) that contains judiciary data on imprisonment and law enforcement, as well as economic data on economic growth and unemployment. Then the research question arose on and is applicable on the aims of the project, whether there is a connection between economic indicators and the justice system.
| Variable name | Data type | Description |
|---|---|---|
| GDP per capita growth | numeric | Percentage point |
| Change in per capita property crime | numeric | Percentage point |
| Year (1980-1993) | integer | Year (for panel data) |
| Income per capita | numeric | Thousands (USD) |
| Police per 100000 residents | numeric | Quota |
| Unemployment | numeric | Percentage point |
| Metropolitan density | numeric | Percentage point |
The plot below is an animated scatterplot with the purpose of showing the relationship between per capita economic growth and changes in per capita property crime. The annum is stated in the upper left corner and as time passes, the states have a tendency moving in the same direction in terms of economic growth, but also to a lower degree in changes in property crime. Per capita income per state is visualized as the color, that also changes as states get richer. When you click on each year, there is no clear pattern of richer or poorer states having more or less crime. Though, the purpose with the plot below was to examine if recessions increase property crime, vice versa, but according to my perception that is not the case as the states do not move in such a uniform pattern.
Animated scatterplot
The plot below is designed to portray the relationship between income per capita and per capita property crime. As the data set consists of 714 rows of observations, hexagonal binning is used to deal with the overlap that occurs. The plot is grided into two categories based on intervals, states with per capita police levels below the median value and above the median value value, respectively. In states with fewer per capita police officers, the additional geom of the FE and time trend display a negative effect of income per capita on per capita property crime when isolating for time- and state-constant factors. An opposite, but smaller indicator occurs in the plot with more per capita police officers.
Hexagonal plot with regression line, time trend and fixed effects
The plot below is a line plot of fitted values when regressing per capita property crime on income per capita and a population density interval type dummy variable. The dummy variable is generated by taking all the values above and below the median to create the variable with the categories “metropolitan” and “rural” respectively. A dummy variable of high and low unemployment is also created in the same way. As the b-value of the fitted lines are low, income per capita barely affects per capita property crime at all. When comparing the grids, states with high unemployment have slightly higher property crime rates.
Faceted prediction plot
The plot below is a faceted proportional stacked density plots of per capita property crime by unemployment rate. The plot is also grided on metropolitian and rural states. These dummy variables are taken from the mutated data that were used to create the last plot. States with high and low per capita property crime in both extremes. There is not a clear difference when comparing the densities between the rural and metropolitan plot either.
Faceted proportional stacked density plot
The plot below shows a two-dimensional density plot of income per capita and per capita violent crime. The plot is faceted on the previously created binary unemployment variable. As the dummy variable has an equal number of observations in either category, the faceted plots are therefore comparable. There is seemingly a slightly positive relationship between income per capita and violent crime.
Faceted 2d density plot
Overall, the relationship with economic indicators and the justice system is not clear in these visualizations. None of the five plots display a clear visual pattern when comparing crime and police density with economic prosperity. The only geom that for example shows a strong linear relationship is the formula and cofficient of determination in the second plot, though where the fitted line is OLS.