Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/delliotthart/esplot
Browse files Browse the repository at this point in the history
  • Loading branch information
dballaelliott committed Jan 13, 2020
2 parents 3a4a651 + babfa06 commit 8645c86
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 76 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ Event study plots are increasingly popular in applied research. `esplot` is a ne

See [site](https://dballaelliott.github.io/esplot) for introduction and overview.

*Coming soon* : Type `help esplot` after installation for internal documentation.
*In Progress* : Type `help esplot` after installation for internal documentation.
1 change: 1 addition & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
theme: jekyll-theme-minimal
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
15 changes: 12 additions & 3 deletions docs/about.md → docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,29 @@ The argument `period_length` takes an integer and allows users to smooth individ

For example, we could have instead typed

`esplot paygrade, by(male) event(to_male_mgr) window(-20 30) period_length(3)`
```stata
set scheme s1rcolor
esplot paygrade, by(male) event(to_male_mgr) \\\
window(-20 30) period_length(3)
```

![Example Figure](img/img2a.svg "Example Figure")

or

`esplot paygrade, by(male) event(to_male_mgr) window(-24 30) period_length(12)`
```stata
set scheme s1color
esplot paygrade, by(male) event(to_male_mgr) \\\
window(-24 30) period_length(12)
```

![Example Figure](img/img2b.svg "Example Figure")

Since the underlying time periods are months, when we set period length to 3, we recover quarter level estimates. When we set period length to 12, we recover <span id="a1"> [annual estimates](#f1 "esplot will trim extraneous periods: read more")</span>.

**The estimate for t=0 is never smoothed, and is always only the event indicator,** i.e. exactly the estimate of the passed event indicator.

As you may have inferred from the examples above, when the `colors` option is not specified, `esplot` defers to the settings of the current scheme.

### Confidence Interval and Estimate Display Options

Expand Down Expand Up @@ -101,4 +110,4 @@ Even more fun things still to come! More graphical options; bounds on attrition.

[](#a1 "Back") <span id="f1">Since -20 and 30 are not evenly divisible by 3, `esplot` effectively truncates the window to [-18,30].</span>



70 changes: 0 additions & 70 deletions esplot.ado
Original file line number Diff line number Diff line change
Expand Up @@ -751,73 +751,3 @@ program check_omitted_events, rclass
end

include log_program.ado
/*
capture program drop log_program
program log_program
syntax anything(name=program id="command" everything) , [depth(integer 1)]
/*
log_program takes in program call and runs it "noisily",
saving output to the log directory
program() should recieve a command as it would be typed interactively.
*/
tokenize `program', parse(" ,")
local prog_name "`1'"
#delimit ;
local skip_progs
impose_only_male lincom_quarter
add_stars get_event_properties
check_omitted_events load_ES_macros;
#delimit cr
local timer_name
timer list
if !strpos("`skip_progs'","`prog_name'"){
forval t = 1/100 {
if "`r(t`t')'" == "" { //if timer is empty
local timer_name `t'
continue, break
}
}
}
if "`timer_name'" != "" timer on `timer_name'
cap: log close `prog_name'
set trace on
set tracedepth 1
log using "logs/v$VERSION/`prog_name'.log", name(`prog_name') replace
tokenize `: subinstr local program "," "|" ', parse("|")
if "`3'" != "" `1', `3'
else `1'
if "`timer_name'" == "" {
di "Could not time program, perhaps all timers all full. If the list has entries [1,100] try typing timer clear and running again"
timer list
}
else {
timer off `timer_name'
quietly: timer list `timer_name'
if "`r(t`timer_name')'" != "" {
local seconds = `r(t`timer_name')'
local hours = floor(`seconds'/3600)
local mins = floor(mod(`seconds',3600)/60)
local sec = round(mod(`seconds', 60))
*---------------------------------------------------------------------------
******************************TIMER RESULTS*********************************
*---------------------------------------------------------------------------
di "took `hours':`mins':`sec' to run `prog_name'"
}
}
log close `prog_name'
set trace off
end
4 changes: 2 additions & 2 deletions examples.do
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ rename idn id
encode id, gen(idn)


cap: mkdir docs
cap: mkdir docs
cap: mkdir docs/img

global esplot_nolog 1
Expand Down Expand Up @@ -49,4 +49,4 @@ graph export img/img5.svg, replace


esplot paygrade, by(male) event(to_male_mgr, nogen) compare(to_fem_mgr, nogen) window(-30 30) period_length(3) vce(cluster idn mgr_id) estimate_reference
graph export img/img5a.svg, replace
graph export img/img5a.svg, replace

0 comments on commit 8645c86

Please sign in to comment.