-
Notifications
You must be signed in to change notification settings - Fork 6
/
wage_share_unemployment_prop1.R
199 lines (145 loc) · 7.08 KB
/
wage_share_unemployment_prop1.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# Graph Designer: Scott Cohn + Simon Halliday
library(shape)
library(pBrackets)
pdf(file = "capitalism/wage_share_unemployment_prop1.pdf", width = 10, height = 8)
#Set parameters for graphics
pointsize <- 1.8
axislabelsize <- 1.8
labelsize <- 1.5
namesize <- 1.8
annotatesize <- 1.5
graphlinewidth <- 2
segmentlinewidth <- 1.5
COL <- c("#7fc97f", "#beaed4", "#fdc086", "#ffff99", "#386cb0", "#f0027f", "#bf5b17", "#666666")
COLA <- c("#e0f3db", "#99d8c9","#66c2a4","#41ae76", "#238b45", "#005824")
COLB <- c("#c6dbef", "#4eb3d3", "#2b8cbe", "#0868ac","#084081")
COLC <- c("#fcfbfd", "#efedf5", "#dadaeb", "#bcbddc", "#9e9ac8", "#807dba", "#6a51a3", "#54278f", "#3f007d")
grays <- gray.colors(25, start = 1, end = 0, alpha = 1)
CBCols <- c("#009E73","#0072B2","#E69F00","#CC79A7", "#F0E442")
# Wage Share
WageFn <- function(h, ubar = 0.173, B = 0.13, t = 0.78) {
B + ubar + (ubar*(1-t))/(t*(1 - h))
}
ulow <- 0.065
eq1 <- uniroot(function(x) WageFn(x) - 0.76 , c(.01,1), tol=1e-8)
as.numeric(eq1[1])*90
eq2 <- uniroot(function(x) WageFn(x) - 0.6 , c(.01,1), tol=1e-8)
as.numeric(eq2[1])*90
#eq3 <- uniroot(function(x) WageFn(x, ubar = ulow) - 0.76 , c(.01,1), tol=1e-8)
#as.numeric(eq3[1])*90
eq3 <- uniroot(function(x) WageFn(x, ubar = ulow) - 0.6 , c(.01,1), tol=1e-8)
as.numeric(eq3[1])*90
xvec <- c(as.numeric(eq1[1]), as.numeric(eq2[1]), as.numeric(eq3[1]))
xlab <- c(as.numeric(eq1[1])*90, as.numeric(eq2[1])*90, as.numeric(eq3[1])*90)
#Edited the margins to cater for the larger LHS labels
par(mar = c(5, 6, 3, 2))
#Add limits on axes and levels of utility for each indifference curve
ylims <- c(0, 1)
xlims <- c(0.6, 1)
npts <- 501
x <- seq(xlims[1], xlims[2], length.out = npts)
y <- seq(ylims[1], ylims[2], length.out = npts)
plot(0, 0, xlim = xlims, ylim = ylims, type = "n",
xlab = expression(paste("")),
ylab = expression(paste("")),
xaxt = "n",
yaxt = "n",
cex.lab = axislabelsize,
bty = "n",
xaxs = "i",
yaxs = "i"
)
#Calculate the Gini
#Area B:
#((0.5*(0.25*0.5)) + 0.25*0.5 + 0.5*(0.75*0.5))
#Therefore Area A:
#0.5 - Area B
#Therefore Gini:
# (0.5 - ((0.5*(0.25*0.5)) + 0.25*0.5 + 0.5*(0.75*0.5)))/0.5 = 0.25
ticksy <- c(ylims[1], 0.6, 0.76, ylims[2])
ylabels <- c(0, expression(paste(0.60)), expression(paste(0.76)), expression(paste(gamma == 1)))
ticksx <- c(xlims[1], xvec[1], xvec[2], xvec[3], xlims[2])
xlabels <- c(60, round(xlab[1],0), round(xlab[2],0), round(xlab[3],0), 90)
ticksy2 <- c(0,1)
# text(0.85/0.9, -0.043, expression(paste(85)), xpd = TRUE, cex = labelsize)
# text(0.83/0.9, -0.042, expression(paste(83)), xpd = TRUE, cex = labelsize)
axis(1,at = ticksx, pos = 0, labels = xlabels, cex.axis = labelsize)
axis(2,at = ticksy, pos = 0.6, labels = ylabels, las = 1, cex.axis = labelsize)
axis(4,at = ticksy2, pos = 1, labels = NA, las = 1, cex.axis = labelsize)
axis.break(axis = 1, bgcol="white", breakcol="black",
style="slash", brw=0.01)
npts <- 500
xx1 <- seq(xlims[1], xlims[2], length.out = npts)
xx2 <- seq(0, xlims[2], length.out = npts)
xx3 <- seq(xlims[1], 0, length.out = npts)
#Axis labels and draw linear utility function
#mtext(expression(paste("Cumulative population proportion, ", F(n))), side = 1, line = 2.5, cex = axislabelsize)
text(xlims[1] - 0.04, 0.5*ylims[2], expression(paste("Wage, w, and wage share, ", sigma[w])), xpd = TRUE, cex = axislabelsize, srt = 90)
text(0.5*(xlims[1] + xlims[2]), -0.1, expression(paste("Employment, ", H)), xpd = TRUE, cex = axislabelsize)
#Shaded Areas A and B
#Area A
#xpoly1 <- c(0, 0.1, 0.9, 1, 0)
#ypoly1 <- c(0, 0, 0.6, 1, 0)
#polygon(x = xpoly1,
# y = ypoly1,
# col = COLB[1], density = NULL, border = NA)
#Area B
#xpoly2 <- c(0, 0.1, 1, 1, 0.9, 0.1)
#ypoly2 <- c(0, 0, 0, 1, 0.6, 0)
#polygon(x = xpoly2,
# y = ypoly2,
# col = COLA[1], density = NULL, border = NA)
# Wage Curve
#lines(xx1, WageFn(xx1, ubar = ulow), col = COLA[6], lwd = graphlinewidth)
lines(xx1, WageFn(xx1), col = COLA[3], lty = 1, lwd = graphlinewidth)
#Segment lines for points
segments(xvec[1], 0, xvec[1], 0.76, lty = 2, col = grays[20], lwd = segmentlinewidth)
segments(xvec[2], 0, xvec[2], 0.6, lty = 2, col = grays[20], lwd = segmentlinewidth)
#segments(xvec[3], 0, xvec[3], 0.6, lty = 2, col = grays[20], lwd = segmentlinewidth)
segments(0, 0.76, 1, 0.76, lty = 1, col = COLB[3], lwd = segmentlinewidth)
segments(0, 0.6, 1, 0.6, lty = 1, col = COLB[5], lwd = segmentlinewidth)
segments(0.6, 1, xlims[2], 1, lty = 2, col = CBCols[3], lwd = graphlinewidth, xpd = TRUE)
# Points
points(xvec[1], 0.76, pch = 16, col = "black", cex = 1.5)
points(xvec[2], 0.6, pch = 16, col = "black", cex = 1.5)
#points(xvec[3], 0.6, pch = 16, col = "black", cex = 1.5)
#points(xvec[2], WageFn(xvec[2], ubar = ulow), pch = 16, col = "black", cex = 1.5)
# Label
text(xvec[1]-0.01, 0.78, expression(paste(a)), cex = labelsize)
text(xvec[2] - 0.01, 0.63, expression(paste(b)), cex = labelsize)
#text(xvec[2] -0.01, WageFn(xvec[2], ubar = ulow)+0.01, expression(paste(c)), cex = labelsize)
#text(xvec[3] + 0.005, 0.58, expression(paste(d)), cex = labelsize)
text(0.74, 0.45, expression(paste("Original")), cex = labelsize)
text(0.74, 0.41, expression(paste("wage")), cex = labelsize)
text(0.74, 0.38, expression(paste("curve, ", w[1]^N )), cex = labelsize)
#Arrows(0.74, 0.36, 0.74, 0.29, col = "black", lty = 1, lwd = 1, arr.type = "triangle", arr.lwd = 0.5, code = 2)
#text(0.74, 0.23, expression(paste("New")), cex = labelsize)
#text(0.74, 0.19, expression(paste("wage")), cex = labelsize)
#text(0.74, 0.16, expression(paste("curve, ", w[2]^N)), cex = labelsize)
text(0.65, 0.88, expression(paste("Original")), cex = labelsize)
text(0.65, 0.84, expression(paste("competition")), cex = labelsize)
text(0.65, 0.8, expression(paste("condition, ", w[1]^c)), cex = labelsize)
Arrows(0.65, 0.75, 0.65, 0.62, col = "black", lty = 1, lwd = 1, arr.type = "triangle", arr.lwd = 0.5, code = 2)
text(0.65, 0.58, expression(paste("New")), cex = labelsize)
text(0.65, 0.54, expression(paste("competition")), cex = labelsize)
text(0.65, 0.5, expression(paste("condition, ", w[2]^c)), cex = labelsize)
text(0.98, 1.06, expression(paste("Output per" )), cex = labelsize, xpd = TRUE)
text(0.98, 1.02, expression(paste("worker hour, ", gamma )), cex = labelsize, xpd = TRUE)
# text(0.9, 0.7, expression(paste(B[3])), cex = labelsize)
#Label and provide Gini value
#Bottom of frame
#segments(0.08, 0.75, 0.32, 0.75, lty = 1, col = "black" , lwd = 1)
#Top of frame
#segments(0.08, 0.85, 0.32, 0.85, lty = 1, col = "black" , lwd = 1)
#Left of frame
#segments(0.08, 0.75, 0.08, 0.85, lty = 1, col = "black" , lwd = 1)
#Right of frame
#segments(0.32, 0.75, 0.32, 0.85, lty = 1, col = "black" , lwd = 1)
#Gini equation
#text(0.2, 0.8, expression(paste(Gini == frac(A, A + B), phantom() == 0.36 )), cex = labelsize)
# brackets(x1 = 1.01, y1 = 1, x2 = 1.01, y2 = 0.252,
# ticks = 0.5, curvature = 0.5, type = 1,
# col = "black", lwd = 2, lty = 1, xpd = TRUE)
# text(1.11, 0.625, expression(paste("Cumulative income")), xpd = TRUE, srt = 270)
# text(1.08, 0.625, expression(paste("of the rich")), xpd = TRUE, srt = 270)
dev.off()