A Table of summary statistics of variables to include: * mean * sd * min-max * dot plots
Statistical Summary Table
Now, we make a statistical summary table. Instrumented variables are rounded in the table for mean, min and max. Perhaps they should be rounded in the DF itself.
Descriptive1 <- matrix(
round(
c(
mean(X1$hur),sd(X1$hur),min(X1$hur),max(X1$hur),
mean(X1$taxcorp), sd(X1$taxcorp), min(X1$taxcorp),max(X1$taxcorp),
mean(X1$ud), sd(X1$ud),min(X1$ud),max(X1$ud),
mean(X1$pslm),sd(X1$pslm),min(X1$pslm),max(X1$pslm),
round(mean(X1$epl),0), sd(X1$epl), round(min(X1$epl),0),round(max(X1$epl),0),
round(mean(X1$wsc),0), sd(X1$wsc), round(min(X1$wsc),0),round(max(X1$wsc),0),
mean(X1$cbc), sd(X1$cbc),min(X1$cbc),max(X1$cbc),
mean(X1$brr1y), sd(X1$brr1y), min(X1$brr1y),max(X1$brr1y),
mean(X1$ttr), sd(X1$ttr),min(X1$ttr),max(X1$ttr),
mean(X1$inf_gdpd),sd(X1$inf_gdpd),min(X1$inf_gdpd),max(X1$inf_gdpd)
), 2),
ncol = 4, byrow = T)
colnames(Descriptive1) <- c("Mean", "SD","Min","Max")
rownames(Descriptive1) <- c("UR","TAXCORP","UD","PSLM","EPL","WSC","CBC","BRR1Y","TTR","Delta_i")
kbl(Descriptive1, caption = "Table 2: Variable Summary Statistics, All Observations") %>%
kable_styling(bootstrap_options = c("striped", "hover","condensed")) %>%
column_spec(1, bold = T)
Now, we need to break down summary statistics by year. We will do this by creating a filtered df per year. These can come in handy in the future as well. This is going to be a fat chunk of code as I’m not going to take the time to learn how to automate. Code is in notebook but echo is false annual_data.R
Table 2.1: Annual Variable Summary Statistics - 2001
| |
Mean |
SD |
Min |
Max |
| UR |
7.17 |
4.17 |
3.08 |
19.46 |
| TAXCORP |
2.78 |
0.91 |
0.58 |
3.90 |
| UD |
29.58 |
17.16 |
12.90 |
73.90 |
| PSLM |
1.65 |
1.18 |
0.41 |
4.02 |
| EPL |
2.00 |
1.02 |
0.00 |
4.00 |
| WSC |
2.00 |
1.56 |
1.00 |
5.00 |
| CBC |
51.37 |
28.71 |
14.70 |
96.00 |
| BRR1Y |
48.62 |
23.42 |
9.00 |
86.00 |
| TTR |
34.40 |
5.65 |
25.53 |
45.92 |
| Delta_i |
3.38 |
2.86 |
-1.08 |
11.05 |
Table 2.2: Annual Variable Summary Statistics - 2002
| |
Mean |
SD |
Min |
Max |
| UR |
7.45 |
3.59 |
3.67 |
18.81 |
| TAXCORP |
3.00 |
1.00 |
0.99 |
4.95 |
| UD |
34.63 |
22.54 |
12.80 |
78.00 |
| PSLM |
1.79 |
1.15 |
0.42 |
4.05 |
| EPL |
2.00 |
1.14 |
0.00 |
5.00 |
| WSC |
3.00 |
1.53 |
1.00 |
5.00 |
| CBC |
59.66 |
29.70 |
14.50 |
96.00 |
| BRR1Y |
54.25 |
23.03 |
9.00 |
86.00 |
| TTR |
34.67 |
6.51 |
24.50 |
45.41 |
| Delta_i |
2.05 |
1.53 |
-1.39 |
4.19 |
Table 2.3: Annual Variable Summary Statistics - 2003
| |
Mean |
SD |
Min |
Max |
| UR |
7.08 |
2.08 |
4.78 |
11.49 |
| TAXCORP |
2.88 |
0.89 |
1.23 |
4.51 |
| UD |
28.58 |
17.48 |
12.40 |
72.40 |
| PSLM |
1.85 |
1.34 |
0.46 |
4.30 |
| EPL |
2.00 |
1.24 |
0.00 |
4.00 |
| WSC |
3.00 |
1.60 |
1.00 |
5.00 |
| CBC |
54.07 |
30.07 |
14.30 |
96.00 |
| BRR1Y |
52.42 |
24.92 |
9.00 |
86.00 |
| TTR |
33.50 |
6.36 |
24.14 |
45.58 |
| Delta_i |
1.83 |
1.38 |
-1.61 |
3.93 |
Table 2.4: Annual Variable Summary Statistics - 2004
| |
Mean |
SD |
Min |
Max |
| UR |
7.81 |
3.29 |
4.28 |
18.36 |
| TAXCORP |
3.42 |
1.78 |
1.51 |
9.69 |
| UD |
30.68 |
19.22 |
10.50 |
73.50 |
| PSLM |
1.74 |
1.24 |
0.36 |
4.23 |
| EPL |
2.00 |
1.06 |
0.00 |
4.00 |
| WSC |
3.00 |
1.37 |
1.00 |
5.00 |
| CBC |
63.09 |
28.53 |
13.80 |
100.00 |
| BRR1Y |
47.83 |
26.67 |
0.00 |
86.00 |
| TTR |
35.36 |
6.21 |
24.76 |
46.39 |
| Delta_i |
2.67 |
1.79 |
-1.12 |
5.84 |
Table 2.5: Annual Variable Summary Statistics - 2005
| |
Mean |
SD |
Min |
Max |
| UR |
6.55 |
2.03 |
3.83 |
11.28 |
| TAXCORP |
3.77 |
2.23 |
1.75 |
11.53 |
| UD |
32.84 |
19.23 |
12.00 |
75.70 |
| PSLM |
1.60 |
1.10 |
0.35 |
3.81 |
| EPL |
2.00 |
0.91 |
0.00 |
4.00 |
| WSC |
3.00 |
1.50 |
1.00 |
5.00 |
| CBC |
59.44 |
31.18 |
13.70 |
100.00 |
| BRR1Y |
46.94 |
25.95 |
0.00 |
86.00 |
| TTR |
36.48 |
6.46 |
25.83 |
48.00 |
| Delta_i |
2.34 |
2.12 |
-1.19 |
8.75 |
Table 2.6: Annual Variable Summary Statistics - 2006
| |
Mean |
SD |
Min |
Max |
| UR |
7.03 |
2.45 |
3.91 |
13.47 |
| TAXCORP |
3.50 |
0.98 |
2.10 |
6.28 |
| UD |
32.84 |
20.92 |
11.50 |
74.30 |
| PSLM |
1.57 |
0.99 |
0.33 |
3.26 |
| EPL |
2.00 |
1.08 |
0.00 |
4.00 |
| WSC |
3.00 |
1.42 |
1.00 |
5.00 |
| CBC |
63.69 |
29.07 |
13.10 |
100.00 |
| BRR1Y |
48.41 |
27.29 |
0.00 |
85.00 |
| TTR |
35.80 |
6.36 |
26.62 |
46.46 |
| Delta_i |
2.11 |
1.43 |
-0.86 |
5.12 |
Table 2.7: Annual Variable Summary Statistics - 2007
| |
Mean |
SD |
Min |
Max |
| UR |
6.27 |
2.20 |
3.58 |
11.23 |
| TAXCORP |
3.41 |
0.81 |
2.19 |
4.80 |
| UD |
29.56 |
18.57 |
11.60 |
70.80 |
| PSLM |
1.30 |
0.86 |
0.31 |
2.73 |
| EPL |
2.00 |
0.93 |
0.00 |
3.00 |
| WSC |
3.00 |
1.49 |
1.00 |
5.00 |
| CBC |
56.04 |
32.63 |
13.30 |
100.00 |
| BRR1Y |
43.81 |
26.13 |
0.00 |
84.00 |
| TTR |
35.96 |
5.97 |
26.73 |
46.42 |
| Delta_i |
2.27 |
1.61 |
-1.36 |
5.34 |
Table 2.8: Annual Variable Summary Statistics - 2008
| |
Mean |
SD |
Min |
Max |
| UR |
6.02 |
2.11 |
2.72 |
11.27 |
| TAXCORP |
3.52 |
2.02 |
1.69 |
11.99 |
| UD |
29.46 |
18.86 |
10.20 |
69.90 |
| PSLM |
1.28 |
0.76 |
0.32 |
2.66 |
| EPL |
2.00 |
0.92 |
0.00 |
4.00 |
| WSC |
3.00 |
1.27 |
1.00 |
5.00 |
| CBC |
61.02 |
29.65 |
13.10 |
100.00 |
| BRR1Y |
49.88 |
23.92 |
0.00 |
83.00 |
| TTR |
35.48 |
6.28 |
23.58 |
44.76 |
| Delta_i |
3.21 |
2.14 |
-0.91 |
10.41 |
Table 2.9: Annual Variable Summary Statistics - 2009
| |
Mean |
SD |
Min |
Max |
| UR |
8.57 |
3.41 |
3.63 |
17.87 |
| TAXCORP |
2.30 |
0.60 |
1.33 |
3.37 |
| UD |
30.63 |
20.13 |
7.60 |
72.50 |
| PSLM |
1.88 |
0.99 |
0.64 |
3.78 |
| EPL |
2.00 |
0.98 |
0.00 |
4.00 |
| WSC |
3.00 |
1.36 |
1.00 |
5.00 |
| CBC |
59.03 |
30.16 |
12.70 |
100.00 |
| BRR1Y |
46.90 |
24.73 |
0.00 |
83.00 |
| TTR |
34.14 |
6.95 |
22.56 |
44.96 |
| Delta_i |
0.75 |
1.95 |
-4.62 |
3.61 |
Table 2.10: Annual Variable Summary Statistics - 2010
| |
Mean |
SD |
Min |
Max |
| UR |
8.24 |
3.71 |
3.71 |
19.88 |
| TAXCORP |
2.67 |
0.99 |
1.31 |
5.75 |
| UD |
28.04 |
18.75 |
8.20 |
71.40 |
| PSLM |
1.71 |
1.01 |
0.54 |
3.99 |
| EPL |
2.00 |
0.87 |
0.00 |
4.00 |
| WSC |
3.00 |
1.21 |
1.00 |
5.00 |
| CBC |
57.42 |
31.56 |
12.20 |
100.00 |
| BRR1Y |
50.38 |
23.68 |
0.00 |
84.00 |
| TTR |
34.04 |
6.71 |
22.38 |
44.76 |
| Delta_i |
1.15 |
1.49 |
-1.88 |
4.65 |
Table 2.11: Annual Variable Summary Statistics - 2011
| |
Mean |
SD |
Min |
Max |
| UR |
8.37 |
3.97 |
3.41 |
21.41 |
| TAXCORP |
2.71 |
1.01 |
1.21 |
4.98 |
| UD |
26.50 |
17.27 |
7.00 |
68.70 |
| PSLM |
1.41 |
1.01 |
0.30 |
3.79 |
| EPL |
2.00 |
0.85 |
0.00 |
4.00 |
| WSC |
3.00 |
1.33 |
1.00 |
5.00 |
| CBC |
52.15 |
32.17 |
12.60 |
100.00 |
| BRR1Y |
46.23 |
25.11 |
0.00 |
83.00 |
| TTR |
33.46 |
6.54 |
21.12 |
44.79 |
| Delta_i |
1.61 |
1.55 |
-1.62 |
5.47 |
Table 2.12: Annual Variable Summary Statistics - 2012
| |
Mean |
SD |
Min |
Max |
| UR |
8.13 |
4.45 |
3.22 |
24.79 |
| TAXCORP |
2.92 |
1.92 |
1.23 |
10.33 |
| UD |
27.32 |
19.61 |
6.00 |
69.20 |
| PSLM |
1.39 |
1.00 |
0.33 |
3.81 |
| EPL |
2.00 |
0.77 |
0.00 |
3.00 |
| WSC |
3.00 |
1.41 |
1.00 |
5.00 |
| CBC |
53.26 |
31.56 |
12.50 |
100.00 |
| BRR1Y |
45.33 |
23.29 |
0.00 |
84.00 |
| TTR |
34.11 |
7.22 |
21.33 |
45.51 |
| Delta_i |
1.78 |
1.21 |
-0.76 |
4.07 |
Table 2.13: Annual Variable Summary Statistics - 2013
| |
Mean |
SD |
Min |
Max |
| UR |
8.26 |
5.05 |
3.10 |
26.12 |
| TAXCORP |
2.93 |
1.51 |
1.19 |
8.26 |
| UD |
27.18 |
18.99 |
10.10 |
68.80 |
| PSLM |
1.58 |
1.11 |
0.35 |
3.56 |
| EPL |
2.00 |
0.86 |
0.00 |
3.00 |
| WSC |
3.00 |
1.36 |
1.00 |
5.00 |
| CBC |
59.32 |
33.28 |
12.40 |
100.00 |
| BRR1Y |
48.53 |
24.95 |
0.00 |
84.00 |
| TTR |
34.99 |
8.08 |
19.86 |
45.89 |
| Delta_i |
1.24 |
0.71 |
-0.35 |
2.56 |
Table 2.14: Annual Variable Summary Statistics - 2014
| |
Mean |
SD |
Min |
Max |
| UR |
8.21 |
4.27 |
3.49 |
24.45 |
| TAXCORP |
2.79 |
1.20 |
1.37 |
6.64 |
| UD |
26.35 |
19.34 |
5.30 |
68.50 |
| PSLM |
1.41 |
0.98 |
0.28 |
3.43 |
| EPL |
2.00 |
0.76 |
0.00 |
3.00 |
| WSC |
3.00 |
1.33 |
1.00 |
5.00 |
| CBC |
52.70 |
31.08 |
8.70 |
100.00 |
| BRR1Y |
42.77 |
24.88 |
0.00 |
84.00 |
| TTR |
34.27 |
7.35 |
19.61 |
48.53 |
| Delta_i |
1.49 |
1.40 |
-0.59 |
5.91 |
Table 2.15: Annual Variable Summary Statistics - 2015
| |
Mean |
SD |
Min |
Max |
| UR |
8.15 |
4.07 |
3.38 |
22.08 |
| TAXCORP |
2.73 |
0.89 |
1.46 |
4.41 |
| UD |
25.16 |
20.00 |
4.50 |
68.20 |
| PSLM |
1.35 |
0.96 |
0.28 |
3.31 |
| EPL |
2.00 |
0.81 |
0.00 |
3.00 |
| WSC |
3.00 |
1.37 |
1.00 |
5.00 |
| CBC |
50.94 |
34.44 |
8.50 |
100.00 |
| BRR1Y |
43.95 |
22.39 |
9.00 |
84.00 |
| TTR |
34.79 |
7.00 |
20.39 |
46.06 |
| Delta_i |
1.30 |
1.24 |
-0.88 |
4.95 |
Table 2.16: Annual Variable Summary Statistics - 2016
| |
Mean |
SD |
Min |
Max |
| UR |
7.12 |
3.69 |
3.12 |
19.65 |
| TAXCORP |
3.00 |
0.91 |
1.61 |
4.88 |
| UD |
23.84 |
18.34 |
7.70 |
67.40 |
| PSLM |
1.28 |
0.79 |
0.26 |
3.14 |
| EPL |
2.00 |
0.83 |
0.00 |
3.00 |
| WSC |
3.00 |
1.37 |
1.00 |
5.00 |
| CBC |
51.90 |
32.09 |
8.30 |
100.00 |
| BRR1Y |
44.36 |
24.45 |
9.00 |
85.00 |
| TTR |
34.85 |
6.29 |
24.75 |
45.49 |
| Delta_i |
0.86 |
1.00 |
-1.47 |
2.48 |
Table 2.17: Annual Variable Summary Statistics - 2017
| |
Mean |
SD |
Min |
Max |
| UR |
6.40 |
3.43 |
2.81 |
17.23 |
| TAXCORP |
3.16 |
1.10 |
1.49 |
5.11 |
| UD |
27.45 |
18.34 |
7.70 |
66.10 |
| PSLM |
1.28 |
0.76 |
0.24 |
2.55 |
| EPL |
2.00 |
0.84 |
0.00 |
3.00 |
| WSC |
3.00 |
1.36 |
1.00 |
5.00 |
| CBC |
54.26 |
33.50 |
8.30 |
100.00 |
| BRR1Y |
47.33 |
22.43 |
8.00 |
84.00 |
| TTR |
35.26 |
6.54 |
22.58 |
44.09 |
| Delta_i |
1.85 |
1.15 |
-0.07 |
4.24 |
Table 2.18: Annual Variable Summary Statistics - 2018
| |
Mean |
SD |
Min |
Max |
| UR |
5.34 |
2.67 |
2.27 |
15.27 |
| TAXCORP |
3.18 |
1.45 |
1.05 |
6.32 |
| UD |
22.02 |
18.21 |
5.90 |
67.50 |
| PSLM |
1.17 |
0.73 |
0.25 |
2.87 |
| EPL |
2.00 |
0.81 |
0.00 |
3.00 |
| WSC |
2.00 |
1.40 |
1.00 |
5.00 |
| CBC |
47.20 |
31.07 |
6.10 |
98.00 |
| BRR1Y |
43.95 |
25.10 |
8.00 |
84.00 |
| TTR |
34.79 |
6.00 |
24.89 |
44.17 |
| Delta_i |
2.09 |
1.24 |
0.00 |
4.85 |
Table 2.19: Annual Variable Summary Statistics - 2019
| |
Mean |
SD |
Min |
Max |
| UR |
4.67 |
1.34 |
2.35 |
6.28 |
| TAXCORP |
2.99 |
1.14 |
1.34 |
4.16 |
| UD |
21.57 |
14.13 |
7.40 |
49.10 |
| PSLM |
1.19 |
0.71 |
0.31 |
2.01 |
| EPL |
2.00 |
1.17 |
0.00 |
4.00 |
| WSC |
3.00 |
1.77 |
1.00 |
5.00 |
| CBC |
48.01 |
40.39 |
7.90 |
98.00 |
| BRR1Y |
41.57 |
24.99 |
8.00 |
77.00 |
| TTR |
35.17 |
6.96 |
24.97 |
43.87 |
| Delta_i |
1.85 |
0.79 |
0.64 |
3.03 |
We will now create data visualizations to inform our expected specification. Hex codes below for copypasta.
| Blue |
#320EF1 |
#CDF10E |
| Red |
#F10E5B |
#0EF1A4 |
| Lt. Green |
#CDF10E |
#320EF1 |
| Green |
#0EF1A4 |
#F10E5B |
# overall hur vs taxcorp, averages
Trend1 <- read.csv("X1.csv") %>%
clean_names()
Trend1 <- Trend1 %>% select(i_time1, location1, hur, taxcorp) %>%
group_by(i_time1) %>%
drop_na() %>%
summarize(mean_ur=mean(hur), mean_taxcorp = mean(taxcorp))
#View(Trend1)
colors <- c("Unemployment Rate" = "#F10E5B", "Corporate Tax Revenue" = "#0EF1A4")
ggplot(Trend1, aes(x=i_time1))+
geom_line(aes(y=mean_ur,color = "Unemployment Rate"))+
geom_line(aes(y=mean_taxcorp,color ="Corporate Tax Revenue"))+
labs(x="Year", y="Mean %", color = "Legend",
title = "Figure 1: Means by Year, Overall",
subtitle = "32 OECD Countries from 2001-2019 N=357", caption = "Chart by Josiah Nelson, Data: OECD 2022a, OECD 2022b")+
scale_color_manual(values = colors)+
ylim(0,10)
### faceted plots for assignment
#hur vs taxcorp by year
ggplot(data=X1)+
geom_point(mapping=aes(x=taxcorp,y=hur), color = "#CDF10E" ) + geom_smooth(mapping=aes(x=taxcorp,y=hur), method = lm, se=F, color = "#320EF1")+
facet_wrap(~i_time1) + labs(x = "TAXCORP", y="UR", title = "Figure 1.1: Unemployment Rate vs Corporate Tax Revenue, By Year")
`geom_smooth()` using formula 'y ~ x'

#hur vs ud
ggplot(data=X1)+
geom_point(mapping=aes(x=ud,y=hur, color = "#320EF1"))+ geom_smooth(mapping=aes(x=ud,y=hur), method = lm, se=F, color = "#CDF10E")+
facet_wrap(~i_time1)+ labs(x = "UD", y="UR", title = "Figure 1.2: Unemployment Rate vs Union Density")
`geom_smooth()` using formula 'y ~ x'

#hur vs pslm
ggplot(data=X1)+
geom_point(mapping=aes(x=pslm,y=hur), color = "#320EF1")+geom_smooth(mapping=aes(x=pslm,y=hur), method = lm, se=F, color = "#CDF10E")+
facet_wrap(~i_time1)+ labs(x = "PSLM", y="UR", title = "Figure 1.3: Unemployment Rate vs Public Spending on Labor Markets")
`geom_smooth()` using formula 'y ~ x'

#hur vs epl
ggplot(data=X1)+
geom_point(mapping=aes(x=epl,y=hur), color = "#320EF1")+geom_smooth(mapping=aes(x=epl,y=hur), method = lm, se=F, color = "#CDF10E")+
facet_wrap(~i_time1)+ labs(x = "EPL", y="UR", title = "Figure 1.4: Unemployment Rate vs Employment Protection Legislation")
`geom_smooth()` using formula 'y ~ x'

#hur vs wsc
ggplot(data=X1)+
geom_point(mapping=aes(x=wsc,y=hur), color = "#320EF1")+geom_smooth(mapping=aes(x=wsc,y=hur), method = lm, se=F, color = "#CDF10E")+
facet_wrap(~i_time1)+ labs(x = "WSC", y="UR", title = "Figure 1.5: Unemployment Rate vs Wage Setting Coordination")
`geom_smooth()` using formula 'y ~ x'

#hur vs cbc
ggplot(data=X1)+
geom_point(mapping=aes(x=cbc,y=hur), color = "#320EF1")+geom_smooth(mapping=aes(x=cbc,y=hur), method = lm, se=F, color = "#CDF10E")+
facet_wrap(~i_time1)+ labs(x = "CBC", y="UR", title = "Figure 1.6: Unemployment Rate vs Collective Bargaining Coverage")
`geom_smooth()` using formula 'y ~ x'

#hur vs brr
ggplot(data=X1)+
geom_point(mapping=aes(x=brr1y,y=hur), color = "#320EF1")+geom_smooth(mapping=aes(x=brr1y,y=hur), method = lm, se=F, color = "#CDF10E")+
facet_wrap(~i_time1)+ labs(x = "BRR", y="UR", title = "Figure 1.7: Unemployment Rate vs Benefit Replacement Rate (1yr)")
`geom_smooth()` using formula 'y ~ x'

#hur vs ttr
ggplot(data=X1)+
geom_point(mapping=aes(x=ttr,y=hur), color = "#320EF1")+geom_smooth(mapping=aes(x=ttr,y=hur), method = lm, se=F, color = "#CDF10E")+
facet_wrap(~i_time1)+ labs(x = "TTR", y="UR", title = "Figure 1.8: Unemployment Rate vs Total Tax Rate")
`geom_smooth()` using formula 'y ~ x'

#hur vs delta_i
ggplot(data=X1)+
geom_point(mapping=aes(x=inf_gdpd,y=hur), color = "#320EF1")+geom_smooth(mapping=aes(x=inf_gdpd,y=hur), method = lm, se=F, color = "#CDF10E")+
facet_wrap(~i_time1)+ labs(x = "delta_i", y="UR", title = "Unemployment Rate vs Change in Inflation")
`geom_smooth()` using formula 'y ~ x'

#hur vs l1_delta_i; lag for science
ggplot(data=X1)+
geom_point(mapping=aes(x=l1_inf_gdpd,y=hur), color = "#320EF1")+geom_smooth(mapping=aes(x=l1_inf_gdpd,y=hur), method = lm, se=F, color = "#CDF10E")+
facet_wrap(~i_time1)+ labs(x = "delta_i", y="UR", title = "Unemployment Rate vs Change in Inflation, t-1")
`geom_smooth()` using formula 'y ~ x'
