I have been performing panel estimations with municipality fixed effects. I would like to produce robustness checks to verify my results. One of the these is the proof of parallel trends. How can I do this with R?
Say I perform 3 regressions for 3 dependent variables (Y) such:
Reg1 <- plm(Y1 ~ X1 + X2 + X3 + X4 + factor(state_year),
index = c("city"),
data = final_panel, model ="within")
Reg2 <- plm(Y2 ~ X1 + X2 + X3 + X4 + factor(state_year),
index = c("city"),
data = final_panel, model ="within")
Reg3 <- plm(Y3 ~ X1 + X2 + X3 + X4 + factor(state_year),
index = c("city"),
data = final_panel, model ="within")
First, I would like to output the results of this regression by year in a table, with the columns corresponding to the 3 dependent variables and the rows corresponding to the years analyzed, with coefficients and standard deviations. Like such:
| Years | Y1 | Y2 | Y3 |
| ----- | --------- | --------- | --------- |
| - 2 | Coef (sd) | Coef (sd) | Coef (sd) |
| - 1 | Coef (sd) | Coef (sd) | Coef (sd) |
| 0 | Coef (sd) | Coef (sd) | Coef (sd) |
| 1 | Coef (sd) | Coef (sd) | Coef (sd) |
| 2 | Coef (sd) | Coef (sd) | Coef (sd) |
Finally, I would like to plot these results to a line graph using ggplot. I think geom_line() + geom_errorbar() might be the way to go.
I would appreciate any help. I'm quite new to R and econometrics so please forgive any errors in the explanation. Thank you so much.