Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: damiancclarke/eventdd
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.0.0
Choose a base ref
...
head repository: damiancclarke/eventdd
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 10 commits
  • 4 files changed
  • 2 contributors

Commits on Nov 22, 2023

  1. Edits to README

    damiancclarke committed Nov 22, 2023
    Copy the full SHA
    1199295 View commit details

Commits on Dec 4, 2023

  1. Update README.md

    damiancclarke authored Dec 4, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    96a51fd View commit details
  2. Copy the full SHA
    23d9e24 View commit details

Commits on Dec 8, 2023

  1. Editing examples

    damiancclarke committed Dec 8, 2023
    Copy the full SHA
    b397697 View commit details
  2. Update README.md

    damiancclarke authored Dec 8, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4cf8d35 View commit details
  3. Adding package file

    damiancclarke committed Dec 8, 2023
    Copy the full SHA
    0d54dfe View commit details
  4. Copy the full SHA
    885bc08 View commit details
  5. Copy the full SHA
    ae85edf View commit details

Commits on Mar 17, 2024

  1. Copy the full SHA
    e1f490f View commit details
  2. Merge pull request #2 from mdavis-xyz/missing_gamma

    add missing coefficient in README equation
    damiancclarke authored Mar 17, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    5b499f6 View commit details
Showing with 37 additions and 15 deletions.
  1. +8 −7 README.md
  2. +9 −0 eventdd.pkg
  3. +12 −8 eventdd.sthlp
  4. +8 −0 stata.toc
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
Panel event study models seek to estimtate the impact of some policy or event adopted in certain groups and time periods, by comparing evolution of outcomes in adoption groups to groups which do not adopt the event. Specifically, the panel event study is estimated as:

```math
y_{gt}= \alpha + \sum_{j=2}^J\beta_j(Lead_j)_{gt} + \sum_{k=0}^K (Lag_k)_{gt} + \mu_g + \lambda_t + X_{gt}^\prime+\varepsilon_{gt}
y_{gt}= \alpha + \sum_{j=2}^J\beta_j(Lead_j)_{gt} + \sum_{k=0}^K \gamma_k (Lag_k)_{gt} + \mu_g + \lambda_t + X_{gt}^\prime+\varepsilon_{gt}
```

where $y_{gt}$ refers to outcomes for group $g$ and time period $t$, $\mu_g$ and $\lambda_t$ refer to group and time-fixed effects respectively, and, optionally, $X_{gt}$ refers to time-varying controls. Lags and leads refer to indicators for periods pre- and post-event occurrence, and are defined as follows:
@@ -42,7 +42,7 @@ ssc install eventdd, replace
```
or using ```net install``` command:
```s
net install sdid, from("https://raw.githubusercontent.com/damiancclarke/eventdd/master") replace
net install eventdd, from("https://raw.githubusercontent.com/damiancclarke/eventdd/master") replace
```

## Syntax
@@ -52,9 +52,9 @@ eventdd depvar [indepvars] [if] [in] [weight], timevar(varname) [options]
where options are:

+ timevar(varname): Specifies the standardized time variable relative to the event of interest. This is required.
+ over(varname): Indicates that multiple event studies should be estimated and plotted, where a separate event study is plotted over each level of the variable indicated. The indicated variable must be discrete, but can take greater than two levels. Resulting graphs will be combined in a single plot.
+ over(varname): Indicates that multiple event studies should be estimated and plotted, where a separate event study is plotted over each level of the variable indicated. The indicated variable must be discrete, but can take greater than two levels, and can be either string or numerical format. Resulting graphs will be combined in a single plot.
+ ci(type, ...): Specifies the type of graph for confidence intervals: rarea (with area shading), rcap (with capped spikes) or rline (with lines), and also the graphing options: twoway rarea for rarea (eg area), twoway rcap for rcap (eg line) or twoway rline for rline (eg connect) which should be passed to the resulting event study graph. rcap is the default graph type. If multiple event studies are produced using the over() option, and separate options are desired for each set of confidence intervals on each event study this can be requested using g1(), g2(), and so forth to pass options, with values corresponding to orderd levels of the variable indicated in the over() option.
+ jitter(#): Only for use if over() is specified. Allows for each event study to be slightly shifted on graphical output to avoid super-imposition. Scalar value indicated in jitter indicates the distance on the horizontal axis to shift each event study.
+ jitter(#): Only for use if over() is specified. Allows for each event study to be slightly shifted on graphical output to avoid super-imposition. Scalar value between 0 and 1 indicated in jitter indicates the distance on the horizontal axis to shift each event study.
+ baseline(#): Specifies the baseline period relative to the moment of the event of interest; the default is -1.
+ level(#): Set confidence level; default is level(95).
+ accum: Accumulates periods beyond indicated leads and lags into a final coefficient/confidence interval.
@@ -196,18 +196,19 @@ gen GDPp25 = lngdp<r(p25)
gen timeToTreat = year-quotaYear
// Event study examining impact of reserved seats on maternal mortality
eventdd lnmmrt i.year, timevar(timeToTreat) method(hdfe, absorb(country) cluster(country)) lags(10) leads(10) accum graph
eventdd lnmmrt i.year, timevar(timeToTreat) method(hdfe, absorb(country) cluster(country)) lags(10) leads(10) accum graph_op(ytitle("ln(Maternal Mortality)") legend(order(2 "Point Estimate" 1 "95% CI") pos(6) rows(1)) ylabel(, format("%04.2f")))
```

<img src="https://github.com/damiancclarke/eventdd/blob/main/quotas.png" width="600" height="400">

```s
eventdd lnmmrt i.year, timevar(timeToTreat) method(hdfe, absorb(country) cluster(country)) lags(10) leads(10) accum over(GDPp25) jitter(0.2) graph_op(legend(pos(6) order(2 "Point Estimate (GDP {&ge} 25 p)" 5 "Point Estimate (GDP < 25 p)" 1 "95% CI") rows(1))) coef_op(g1(ms(Sh)) g2(ms(Oh))) ci(rarea, g1(color(gs12%30)) g2(color(gs12%50)))
eventdd lnmmrt i.year, timevar(timeToTreat) method(hdfe, absorb(country) cluster(country)) lags(10) leads(10) accum over(GDPp25) jitter(0.2) graph_op(ytitle("ln(Maternal Mortality)") legend(pos(6) order(2 "Point Estimate (GDP {&ge} 25 p)" 5 "Point Estimate (GDP < 25 p)" 1 "95% CI") rows(1)) ylabel(, format("%04.2f"))) coef_op(g1(ms(Sh)) g2(ms(Oh))) ci(rarea, g1(color(gs12%30)) g2(color(gs12%50)))
```

<img src="https://github.com/damiancclarke/eventdd/blob/main/quotasByGDP.png" width="600" height="400">

## Citation
## Authors
**eventdd** is written by Kathya Tapia Schythe (University of California, Davis) and Damian Clarke (University of Chile & University of Exeter).

If you use **eventdd** and would like to cite it, please cite either the paper and/or the command's [RePEc citation](https://ideas.repec.org/c/boc/bocode/s458737.html). BiBTeX citations for the paper are

9 changes: 9 additions & 0 deletions eventdd.pkg
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
v 4.0.0
d 'EVENTDD': Estimate panel event study models and generate event study plots
d
d Distribution-Date: 2023-12-08
d License: GNU v3.0
d
F eventdd.ado
F eventdd_estat.ado
F eventdd.sthlp
20 changes: 12 additions & 8 deletions eventdd.sthlp
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@
{synopt:{opt timevar(varname)}} Specifies the standardized time variable relative to the event of interest. This is required.
{p_end}
{synopt:{opt over(varname)}} Indicates that multiple event studies should be estimated and plotted, where a separate event study is plotted over each level
of the variable indicated. The indicated variable must be discrete, but can take greater than two levels. Resulting graphs will be combined in a single plot.
of the variable indicated. The indicated variable must be discrete (either string or numeric), and can take greater than two levels. Resulting graphs will be combined in a single plot.
{p_end}
{synopt:{opt ci(type, ...)}} Specifies the type of graph for confidence intervals: {cmd:rarea} (with area shading),
{cmd:rcap} (with capped spikes) or {cmd:rline} (with lines), and also the graphing options: {help twoway_rarea:twoway rarea} for {cmd:rarea} (eg area), {help twoway_rcap:twoway rcap}
@@ -37,7 +37,7 @@ for each set of confidence intervals on each event study
this can be requested using g1(), g2(), and so forth to pass options, with values corresponding to orderd levels of the variable indicated in the {cmd:over()} option.
{p_end}
{synopt:{opt jitter(#)}} Only for use if {cmd:over()} is specified. Allows for each event study to be slightly shifted on
graphical output to avoid super-imposition. Scalar value indicated in jitter indicates the distance on the horizontal axis to shift each event study.
graphical output to avoid super-imposition. Scalar value between 0 and 1 provided in jitter indicates the distance on the horizontal axis to shift each event study.
{p_end}
{synopt:{opt baseline(#)}} Specifies the baseline period relative to the moment of the event of interest; the default is -1.
{p_end}
@@ -145,7 +145,8 @@ the event, with missing values for units in which the event never occurs (pure c
{phang}
{opt over(varname)} Allows for the estimation and plotting of multiple event studies on a
single plot. Event studies are estimated separately and plotted for each level of the variable
indicated in {cmd:over()}. This variable must be categorical, but can take more than two levels,
indicated in {cmd:over()}. This variable must be categorical (in either string or numeric
formats), but can take more than two levels,
and event studies will be plotted for each level. Output for each model will be provided, and
graphical results are combined on a single plot.

@@ -166,8 +167,9 @@ two event studies over a variable specified in {cmd:over()} this can be achieve
{p_end}
{phang}
{opt jitter(#)} Allows for event studies to be slightly shifted on the horizontal axis when multiple
models are presented in a single plot. All coefficients and confidence intervals will be shifted by
the units indicated. This option should only be used in combination with {cmd:over()}.
models are presented in a single plot. Jitter can take values between 0 and 1, and all coefficients and
confidence intervals will be shifted by the units indicated. This option should only be used in
combination with {cmd:over()}.

{pstd}
{p_end}
@@ -394,7 +396,8 @@ Estimate event study stratifying by whether or not countries are in bottom quart
{synopt:{cmd:e(lags)}}all event lags, their lower bound, the point estimate, and their upper bound{p_end}
{synopt:{cmd:e(V_leads_lags)}}variance-covariance matrix of leads and lags estimators{p_end}

In the case that {cmd:over()} is specified and multiple event-studies are produced, instead of the matrices indicated above, a set of matrices named as below are returned, for each level # of the variable indicated on {cmd:over}:
{pstd}
In the case that {cmd:over()} is specified and multiple event-studies are produced, instead of the matrices indicated above, a set of matrices named as below are returned for each level # of the variable indicated in {cmd:over}:

{synoptset 20 tabbed}{...}
{p2col 5 20 24 2: Matrices}{p_end}
@@ -403,6 +406,7 @@ In the case that {cmd:over()} is specified and multiple event-studies are produc
{synopt:{cmd:e(leads_g#)}}all event leads, their lower bound, the point estimate, and their upper bound{p_end}
{synopt:{cmd:e(lags_g#)}}all event lags, their lower bound, the point estimate, and their upper bound{p_end}
{synopt:{cmd:e(V_leads_lags_g#)}}variance-covariance matrix of leads and lags estimators{p_end}
{synopt:{cmd:e(group_id)}}Table providing correspondence between the levels of the variable indicated in {cmd:over()} to group numbers indicated as # in matrices above.{p_end}


{pstd}
@@ -518,8 +522,8 @@ Economics 121(1):267-288.
Damian Clarke, Universidad de Chile.
Email {browse "mailto:dclarke@fen.uchile.cl":dclarke@fen.uchile.cl}

Kathya Tapia, Universidad de Santiago de Chile.
Email {browse "mailto:kathya.tapia@usach.cl":kathya.tapia@usach.cl}
Kathya Tapia, University of California, Davis.
Email {browse "mailto:kattapia@ucdavis.edu":kattapia@ucdavis.edu}



8 changes: 8 additions & 0 deletions stata.toc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
v 4.0.0
d Damian Clarke and Kathya Tapia Schythe
d dclarke@fen.uchile.cl - kattapia@ucdavis.edu
d https://github.com/damiancclarke/eventdd

d 'eventdd': Estimate panel event study models and generate event study plots

p eventdd