-
Notifications
You must be signed in to change notification settings - Fork 17
FIG_4.1.1
Matthieu Stigler edited this page Apr 15, 2014
·
1 revision
library(RcompAngrist)
library(plyr)
library(ggplot2)
Reshape data:
data(AngKrug91)
AK91_Q <- ddply(AngKrug91, .(yqob), summarize, lwklywge_Q = mean(lwklywge),
educ_Q = mean(educ), Quarter = factor(unique(qob)))
Plot
plot_Wage <- qplot(x = yqob, y = lwklywge_Q, data = AK91_Q, geom = "line") +
geom_point(aes(colour = Quarter), size = 3) + theme(legend.position = "bottom") +
scale_x_continuous(breaks = 30:39) + xlab("Year of birth") + ylab("Log weekly earnings")
plot_Wage
And second plot:
plot_Educ <- qplot(x = yqob, y = educ_Q, data = AK91_Q, geom = "line") + geom_point(aes(colour = Quarter),
size = 3) + theme(legend.position = "bottom") + scale_x_continuous(breaks = 30:39) +
xlab("Year of birth") + ylab("Years of education")
plot_Educ