Skip to content

Commit

Permalink
Rename to eventbaseline (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
Miklós Koren committed Jan 23, 2024
1 parent 416d31e commit 18f6bac
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 62 deletions.
6 changes: 3 additions & 3 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

cff-version: 1.2.0
title: EVENTSTUDY - Correct Event Study After XTHDIDREGRESS
title: EVENTBASELINE - Correct Event Study After XTHDIDREGRESS
message: >-
If you use this software, please cite it using the
metadata from this file.
Expand All @@ -11,5 +11,5 @@ authors:
identifiers:
- type: url
value: 'https://github.com/codedthinking/eventstudy'
version: 0.5.3
date-released: '2024-01-22'
version: 0.6.0
date-released: '2024-01-23'
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
all: eventstudy.sthlp eventstudy.pkg
eventstudy.sthlp: README.md smcl.lua
all: eventbaseline.sthlp eventbaseline.pkg
eventbaseline.sthlp: README.md smcl.lua
pandoc -f gfm -t smcl.lua $< > $@
smcl.lua:
curl -sLo $@ "https://raw.githubusercontent.com/korenmiklos/pandoc-smcl/master/smcl.lua"
Expand Down
30 changes: 13 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
---
author: Koren, Miklós (https://koren.mk)
date: 2024-01-22
version: 0.5.3
title: EVENTSTUDY - Correct Event Study After XTHDIDREGRESS
date: 2024-01-23
version: 0.6.0
title: EVENTBASELINE - Correct Event Study After XTHDIDREGRESS
description: |
`eventstudy` transforms the coefficients estimated by `xthdidregress` into a correct
event study relative to a baseline. The reported coefficients are the average
treatment effects on the treated (ATT) for each period relative to the baseline.
The baseline can be either a period before the treatment or the average of the
pre-treatment periods.
`eventbaseline` transforms the coefficients estimated by `xthdidregress` into a correct event study relative to a baseline. The reported coefficients are the average treatment effects on the treated (ATT) for each period relative to the baseline. The baseline can be either a period before the treatment or the average of the pre-treatment periods.
url: https://github.com/codedthinking/eventstudy
requires: Stata version 18
files:
Expand All @@ -17,13 +13,13 @@ files:
- LICENSE
- testdata.dta
---
# `eventstudy` Correct event study after `xthdidregress`
# `eventbaseline` Correct event study after `xthdidregress`

# Syntax

- `eventstudy`, [**pre**(#) **post**(#) **baseline**(*string*) **generate**(*name*)]
- `eventbaseline`, [**pre**(#) **post**(#) **baseline**(*string*) **generate**(*name*)]

`eventstudy` transforms the coefficients estimated by `xthdidregress` into a correct event study relative to a baseline. The reported coefficients are the average treatment effects on the treated (ATT) for each period relative to the baseline. The baseline can be either a period before the treatment or the average of the pre-treatment periods.
`eventbaseline` transforms the coefficients estimated by `xthdidregress` into a correct event study relative to a baseline. The reported coefficients are the average treatment effects on the treated (ATT) for each period relative to the baseline. The baseline can be either a period before the treatment or the average of the pre-treatment periods.


The package can be installed with
Expand All @@ -41,7 +37,7 @@ Option | Description
**generate** (optional) | Name of the frame to store the coefficients and their confidence interval.

# Background
`xthdidregress` returns ATET between `t` and `t-1` whenever `t` is before the treatment. That is, pretrends are reported as first differences, whereas actual treatment effects are reported as difference relative to the period before treatment. This can lead to misleading event study plots. The `eventstudy` command transforms the coefficients into a correct event study relative to a baseline.
`xthdidregress` returns ATET between `t` and `t-1` whenever `t` is before the treatment. That is, pretrends are reported as first differences, whereas actual treatment effects are reported as difference relative to the period before treatment. This can lead to misleading event study plots. The `eventbaseline` command transforms the coefficients into a correct event study relative to a baseline.

# Remarks
The command can only be run after `xthdidregress`.
Expand All @@ -62,7 +58,7 @@ The frame is `tsset` by `time`, so `tsline` can be used to plot the event study.
. xthdidregress ra (y) (treatment), group(group)
. eventstudy, pre(3) post(3) baseline(-3) generate(eventstudy)
. eventbaseline, pre(3) post(3) baseline(-3) generate(eventstudy)
Time variable: time, -3 to 3
Delta: 1 unit
Expand Down Expand Up @@ -104,7 +100,7 @@ Event study relative to -3 Number of obs = 662
```
. xthdidregress ra (y) (treatment), group(group)
. eventstudy, pre(3) post(3) baseline(atet)
. eventbaseline, pre(3) post(3) baseline(atet)
Event study relative to atet Number of obs = 662
Expand All @@ -118,9 +114,9 @@ Event study relative to atet Number of obs = 662


# Authors
- Miklós Koren (Central European University), *maintainer*
- Miklós Koren (Central European University, https://koren.mk), *maintainer*

# License and Citation
You are free to use this package under the terms of its [license](LICENSE). If you use it, please cite *both* the original article and the software package in your work:
You are free to use this package under the terms of its [license](LICENSE). If you use it, please the software package in your work:

- Koren, Miklós. 2024. "EVENTSTUDY: Correct Event Study After XTHDIDREGRESS. [software]" Available at https://github.com/codedthinking/eventstudy.
- Koren, Miklós. 2024. "EVENTBASELINE: Correct Event Study After XTHDIDREGRESS. [software]" Available at https://github.com/codedthinking/eventstudy.
4 changes: 2 additions & 2 deletions eventstudy.ado → eventbaseline.ado
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
*! version 0.5.3 22jan2024
program eventstudy, eclass
*! version 0.6.0 23jan2024
program eventbaseline, eclass
syntax [, pre(integer 1) post(integer 3) baseline(string) generate(string) level(real 95)]
if ("`level'" == "") {
local level 95
Expand Down
23 changes: 23 additions & 0 deletions eventbaseline.pkg
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

v 3

d EVENTBASELINE - Correct Event Study After XTHDIDREGRESS
d
d Authors: Koren, Miklós (https://koren.mk)
d Support:
d
d `eventbaseline` transforms the coefficients estimated by `xthdidregress` into a correct event study relative to a baseline. The reported coefficients are the average treatment effects on the treated (ATT) for each period relative to the baseline. The baseline can be either a period before the treatment or the average of the pre-treatment periods.
d
d For details, see website:
d https://github.com/codedthinking/eventstudy
d
d Requires: Stata version 18
d
d Distribution-Date: 20240123
d


f eventstudy.ado
f eventstudy.sthlp
f LICENSE
f testdata.dta
20 changes: 10 additions & 10 deletions eventstudy.sthlp → eventbaseline.sthlp
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{smcl}


{marker eventstudy-correct-event-study-after-xthdidregress}{...}
{title:{cmd:eventstudy} Correct event study after {cmd:xthdidregress}}
{marker eventbaseline-correct-event-study-after-xthdidregress}{...}
{title:{cmd:eventbaseline} Correct event study after {cmd:xthdidregress}}


{marker syntax}{...}
{title:Syntax}

{text}{phang2}{cmd:eventstudy}, [{bf:pre}(#) {bf:post}(#) {bf:baseline}({it:string}) {bf:generate}({it:name})]{p_end}
{text}{phang2}{cmd:eventbaseline}, [{bf:pre}(#) {bf:post}(#) {bf:baseline}({it:string}) {bf:generate}({it:name})]{p_end}


{pstd}{cmd:eventstudy} transforms the coefficients estimated by {cmd:xthdidregress} into a correct event study relative to a baseline. The reported coefficients are the average treatment effects on the treated (ATT) for each period relative to the baseline. The baseline can be either a period before the treatment or the average of the pre-treatment periods.{p_end}
{pstd}{cmd:eventbaseline} transforms the coefficients estimated by {cmd:xthdidregress} into a correct event study relative to a baseline. The reported coefficients are the average treatment effects on the treated (ATT) for each period relative to the baseline. The baseline can be either a period before the treatment or the average of the pre-treatment periods.{p_end}

{pstd}The package can be installed with{p_end}

Expand All @@ -38,7 +38,7 @@
{marker background}{...}
{title:Background}

{pstd}{cmd:xthdidregress} returns ATET between {cmd:t} and {cmd:t-1} whenever {cmd:t} is before the treatment. That is, pretrends are reported as first differences, whereas actual treatment effects are reported as difference relative to the period before treatment. This can lead to misleading event study plots. The {cmd:eventstudy} command transforms the coefficients into a correct event study relative to a baseline.{p_end}
{pstd}{cmd:xthdidregress} returns ATET between {cmd:t} and {cmd:t-1} whenever {cmd:t} is before the treatment. That is, pretrends are reported as first differences, whereas actual treatment effects are reported as difference relative to the period before treatment. This can lead to misleading event study plots. The {cmd:eventbaseline} command transforms the coefficients into a correct event study relative to a baseline.{p_end}


{marker remarks}{...}
Expand Down Expand Up @@ -66,7 +66,7 @@

. xthdidregress ra (y) (treatment), group(group)

. eventstudy, pre(3) post(3) baseline(-3) generate(eventstudy)
. eventbaseline, pre(3) post(3) baseline(-3) generate(eventstudy)

Time variable: time, -3 to 3
Delta: 1 unit
Expand Down Expand Up @@ -106,7 +106,7 @@ Event study relative to -3 Number of obs = 662

{phang2}{cmd}. . xthdidregress ra (y) (treatment), group(group)

. eventstudy, pre(3) post(3) baseline(atet)
. eventbaseline, pre(3) post(3) baseline(atet)

Event study relative to atet Number of obs = 662

Expand All @@ -120,13 +120,13 @@ Event study relative to atet Number of obs = 662
{marker authors}{...}
{title:Authors}

{text}{phang2}Miklós Koren (Central European University), {it:maintainer}{p_end}
{text}{phang2}Miklós Koren (Central European University, {browse "https://koren.mk":https://koren.mk}), {it:maintainer}{p_end}



{marker license-and-citation}{...}
{title:License and Citation}

{pstd}You are free to use this package under the terms of its {browse "LICENSE":license}. If you use it, please cite {it:both} the original article and the software package in your work:{p_end}
{pstd}You are free to use this package under the terms of its {browse "LICENSE":license}. If you use it, please the software package in your work:{p_end}

{text}{phang2}Koren, Miklós. 2024. "EVENTSTUDY: Correct Event Study After XTHDIDREGRESS. [software]" Available at {browse "https://github.com/codedthinking/eventstudy":https://github.com/codedthinking/eventstudy}.{p_end}
{text}{phang2}Koren, Miklós. 2024. "EVENTBASELINE: Correct Event Study After XTHDIDREGRESS. [software]" Available at {browse "https://github.com/codedthinking/eventstudy":https://github.com/codedthinking/eventstudy}.{p_end}
27 changes: 0 additions & 27 deletions eventstudy.pkg

This file was deleted.

2 changes: 1 addition & 1 deletion stata.toc
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
v 3
d Koren, Miklós (https://koren.mk)
d https://github.com/codedthinking/eventstudy
p eventstudy EVENTSTUDY - Correct Event Study After XTHDIDREGRESS
p eventbaseline EVENTBASELINE - Correct Event Study After XTHDIDREGRESS

0 comments on commit 18f6bac

Please sign in to comment.