-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
20af43a
commit 83188e0
Showing
4 changed files
with
109 additions
and
64 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
from differences import simulate_data, ATTgt | ||
|
||
panel_data = simulate_data() # generate data | ||
|
||
att_gt = ATTgt(data=panel_data, cohort_name='cohort') | ||
|
||
att_gt.fit(formula='y ~ x0') | ||
|
||
att_gt.aggregate('time') | ||
|
||
att_gt.aggregate('event') | ||
|
||
att_gt.aggregate('cohort') | ||
|
||
att_gt.aggregate('simple') | ||
|
||
att_gt.aggregate('event', overall=True) | ||
|
||
# heterogeneity | ||
|
||
panel_data = simulate_data(samples=3) | ||
|
||
att_gt = ATTgt(data=panel_data, cohort_name='cohort') | ||
|
||
att_gt.fit(formula='y', split_sample_by='samples') | ||
|
||
att_gt.aggregate('event') | ||
|
||
att_gt.aggregate('simple') | ||
|
||
# triple difference | ||
att_gt.aggregate('time', difference=['samples = 1', 'samples = 2']) | ||
|
||
# multi-valued treatment | ||
panel_data = simulate_data(intensity_by=2) # generate data | ||
|
||
att_gt = ATTgt(data=panel_data, cohort_name='cohort', strata_name='strata') | ||
|
||
att_gt.fit(formula='y', n_jobs=1) | ||
|
||
att_gt.aggregate('event') | ||
|
||
att_gt.aggregate('simple') | ||
|
||
att_gt.aggregate('event', difference=[0, 1], boot_iterations=5000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.