*! version 1

Title

jwdid post-estimation -- JWDID Post Estimation

Syntax

estat
[aggregation]
[, options]

Main
simple Estimates the ATT for all groups across all periods.

group Estimates the ATT for each group or cohort, over all periods.

calendar Estimates the ATT for each period, across all groups or cohorts.

event Dynamic aggregation. When default option is used (not-yet treated)
this option only provides the post-treatment ATT aggregations.

Because jwdid uses margins to estimate the ATT, you can use many margins options, including "post" to store the output for further reporting, or predict()
to produce results for other outcomes (other than default).

However, I added extra options to faciliate storing, as well as alternative effects.

Options
plot[(plotting options)] You can request plotting the results after producing them. THis follows a syntax similar to margins, plot[()]
Everything in parenthesis are two-way option plots that can be added to the figure construction.

esave(name) Saves the output into a ster file

estore(name) Saves the output in memory under name

other(varname) When using calendar, group or event aggregations, you can request getting the aggregations for specific subgroups. Say excluding first and last event period.
This should be specified with a dummy that identifies with 1 observations to be kept in the analysis

over(varname) When using simple, one can request to estimate "simple" estimates across multiple subgroups. For example,
to reproduce ATTGTs for all post-treament data in nonlinear model

Description

jwdid comes with a basic post-estimation command that estimates 4 types of aggregations:
Simple, Calendar, group and event/dynamic ATTs. These are similar to the aggregations based on csdid.

All estimations are constructed using margins turning on and off the "treatment" dummy __tr__.
You can use many margins options, including "post" to store the output for further reporting. For example, using predict(xb) to
get effects based on the linear predictor.

When other estimation methods are used (probit/poisson) margins are calculated based on the default options in margins.

The command allows you to directly save -esave- or store -estore- the outcomes from margins. As well as estimate margins for other subsamples using
the -other(varname)- and -over(name) options.

You can also request to create plots right after producing the aggregations. This follows a syntax similar to margins, plot[()].

Remarks

This code shows how simple is to produce Aggregations for ATT's based on this approach.
However, as experienced with the first round of CSDID, when you have too many periods and cohorts,
the aggregations may take some time.

Also, all errors are my own. And this code was not necessarily checked by Prof Wooldridge. So if something looks different from his, look into his work.

Examples

Setup: Estimation of ATTGTs without controls using not-yet treated groups

ssc install frause

frause mpdta.dta, clear

jwdid lemp, ivar(countyreal) tvar(year) gvar(first_treat)

Aggregations:

estat simple

estat calendar

estat group

estat event

Using Never treated as controls

jwdid lemp, ivar(countyreal) tvar(year) gvar(first_treat) never

estat simple

estat calendar

estat group

estat event

Using a single control variable

jwdid lemp lpop, ivar(countyreal) tvar(year) gvar(first_treat)

estat simple

estat calendar

estat group

estat event

Using a single control variable and poisson

gen emp = exp(lemp)

jwdid emp lpop, ivar(countyreal) tvar(year) gvar(first_treat) method(poisson)

estat simple

estat calendar

estat group

estat event

Using a different outcome

estat event, predict(xb)

jwdid_plot: Plots after jwdid

jwdid also comes with its own command to produce simple plots for all aggregations.
It automatically recognizes last estimated results left by jwdid post estimation to produce the corresponding plots.
This command is what is called when using -plot[()] option with -estat-.

Syntax

jwdid_plot, [options]

Plot options

style(styleoption) Allows you to change the style of the plot. The options are rspike (default), rarea, rcap and rbar.

title(str) Sets title for the constructed graph

xtitle(str) Sets title for horizontal axis

ytitle(str) Sets title for vertical axis axis

name(str) Request storing a graph in memory under name

pstyle[1|2](stype) This can be used to choose an overall style for the figure colors. Default is p1 for pstyle1 and p2 for pstyle2. pstyle2 is only used for event style plots.

color[1|2](colorstyle) This can be used to choose a color for areas of the figures. It superseeds pstyle if a color is defined, but complements it if using transparency or intencity. Default depends on the type of graph style, but is set at %40 for rspike.

lwidth[1|2](options) This can be used to select width of line in figure. It affects the tickness of the countours of Area type plots. Default depends on the type of graph style.

Other twoway graph options are allowed.

Remarks

The command jwdid_plot is an easy-to-use command to plot different ATT aggregations, either across groups,
across time, or dynamic effects, (event plot). Its a clone of csdid_plot. It has, however, limited flexibility

If you want to further modify this figure, I suggest using the community contributed command addplot by Benn Jan.
If you do, please cite his software. See references section.

Examples

Setup: Estimation of ATTGTs without controls using never treated as controls

ssc install frause

frause mpdta.dta, clear

jwdid lemp, ivar(countyreal) tvar(year) gvar(first_treat) never

Estimation of event aggretation

estat event

Plot

jwdid_plot

jwdid_plot, pstyle1(p3)

jwdid_plot, xscale(range(-4.5/3.5))

`"jwdid_plot, legend(order(1 "Before" 3 "After"))"'

`"jwdid_plot, style(rbar)"'

Authors

Fernando Rios-Avila

Levy Economics Institute of Bard College

Annandale-on-Hudson, NY

friosavi@levy.org

References

Wooldridge, Jeffrey. 2021.
Two-Way Fixed Effects, the Two-Way Mundlak Regression, and
Differences-in-Differences
estimators. Working paper.

Wooldridge, Jeffrey. 2022.
Simple Approaches to Nonlinear Difference-in-Differences
with Panel Data. Working paper.

Jann, B. (2014). addplot: Stata module to add twoway plot objects to an existing twoway graph. Available from
http://ideas.repec.org/c/boc/bocode/s457917.html.

Acknowledgement

This command was put together just for fun, and
as my last push of "productivity" before my
baby girl was born! Who is now 15months!

jwdid_plot was also written due to request of people interested in this estimator.

Also see

Help: drdid, csdid, csdid_postestimation,
jwdid, jwdid_postestimation, xtdidregress