Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.9.9 (Double) #11

Merged
merged 47 commits into from
Sep 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
4e91456
initial ggtatt without aggregation or isolation
TsaiLintung Aug 3, 2024
eab9abc
rough sketch
TsaiLintung Aug 3, 2024
8f8b36a
try to resolve conf
TsaiLintung Aug 3, 2024
94c125b
again
TsaiLintung Aug 3, 2024
f3273eb
Merge branch 'main' into double
TsaiLintung Aug 3, 2024
37fae8a
as if nothing have happened (later only no cov)
TsaiLintung Aug 3, 2024
1446943
rough start for coverage test
TsaiLintung Aug 4, 2024
b566c9d
Merge branch 'main' into double
TsaiLintung Aug 6, 2024
29e6658
add full result mode, lock intermediate objects
TsaiLintung Aug 6, 2024
164cc02
seems to be working
TsaiLintung Aug 6, 2024
2ad3254
too conservative, maybe only agg weight should have wif
TsaiLintung Aug 6, 2024
bda96bd
maybe?
TsaiLintung Aug 7, 2024
830d1d6
lets go
TsaiLintung Aug 7, 2024
5447e79
make it look a bit prettier
TsaiLintung Aug 7, 2024
803a164
add coverage test
TsaiLintung Aug 7, 2024
66a1ddd
some opt, update weight influence
TsaiLintung Aug 7, 2024
500425e
move design matrix to reduce memory
TsaiLintung Aug 7, 2024
618ed4c
some more g1 g2 opt
TsaiLintung Aug 7, 2024
586955f
prepare for parallelization
TsaiLintung Aug 7, 2024
0452376
Revert "prepare for parallelization"
TsaiLintung Aug 7, 2024
40f62e3
Reapply "prepare for parallelization"
TsaiLintung Aug 7, 2024
7684482
fix the coverage problem
TsaiLintung Aug 7, 2024
6a94789
add parallization, worry about windows later :)
TsaiLintung Aug 8, 2024
27fcf71
Update fastdid_0_9_4.R
TsaiLintung Aug 8, 2024
5f8815c
fix some bugs
TsaiLintung Aug 10, 2024
505af81
fix bugs
TsaiLintung Aug 11, 2024
8ce6362
add coverage test
TsaiLintung Aug 11, 2024
176dcc4
add coverage tests
TsaiLintung Aug 11, 2024
54dcf07
coverage test for unbalanced or
TsaiLintung Aug 11, 2024
6c3e30c
Update estimate_gtatt.R
TsaiLintung Aug 12, 2024
075baa6
add confoundedness diagnosis
TsaiLintung Aug 16, 2024
2d09ac4
add plot generics
TsaiLintung Aug 16, 2024
ed9e14c
Add NEWS.md
TsaiLintung Aug 16, 2024
86b7dcf
Add NEWS.md
TsaiLintung Aug 16, 2024
6576d96
Add GitHub links to DESCRIPTION
TsaiLintung Aug 16, 2024
4731834
update license
TsaiLintung Aug 16, 2024
7e0c8c8
skeleton for package page
TsaiLintung Aug 16, 2024
5af9438
reorganize
TsaiLintung Aug 16, 2024
823bc7a
change diag generics
TsaiLintung Aug 23, 2024
2fbcf17
update docs
TsaiLintung Aug 24, 2024
23346ba
add non-num cov check
TsaiLintung Aug 25, 2024
e69fbe6
just use D2 as outcome is diag lmao
TsaiLintung Aug 25, 2024
f15625f
just need the paper now
TsaiLintung Aug 25, 2024
a881011
update news
TsaiLintung Aug 26, 2024
58c94c2
Update README.md
TsaiLintung Aug 26, 2024
a0290c6
just the link
TsaiLintung Sep 8, 2024
c0ddddd
add coming soon
TsaiLintung Sep 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
5 changes: 5 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@
^development

^\.github$
^cran-comments\.md$
^LICENSE\.md$
^_pkgdown\.yml$
^docs$
^pkgdown$
50 changes: 50 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: pkgdown.yaml

permissions: read-all

jobs:
pkgdown:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
clean: false
branch: gh-pages
folder: docs
31 changes: 31 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Run tests and upload coverage

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

jobs:
test:
name: Run tests and collect coverage
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Node
uses: actions/setup-node@v4

- name: Install dependencies
run: npm install

- name: Run tests
run: npx jest --coverage

- name: Upload results to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ vignettes/*.pdf

#interactive stuff
*development/old
*development/output
*development/output
docs
inst/doc
29 changes: 19 additions & 10 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,28 +1,37 @@
Package: fastdid
Type: Package
Title: lightning-fast staggered Difference-in-Difference estimators
Version: 0.9.4
Date: 2024-08-05
Title: Fast Staggered Difference-in-Difference Estimators
Version: 0.9.9
Date: 2024-09-08
Authors@R: c(
person("Lin-Tung","Tsai",
role = c("aut", "cre"),
role = c("aut", "cre", "cph"),
email = "[email protected]"),
person(given = "Maxwell",
family = "Kellogg", ,
role = "aut"),
role = "ctb"),
person(given = "Kuan-Ju",
family = "Tseng", ,
role = "aut"))
role = "ctb"))
Maintainer: Lin-Tung Tsai <[email protected]>
Description: **fastdid** is a lightning-fast implementation of Callaway and Sant'Anna's (2021)<https://www.sciencedirect.com/science/article/pii/S0304407620303948> staggered Difference-in-Differences (DiD) estimators. DiD setup for millions of units used to take hours to run. With **fastdid**, it takes seconds.
License: GPL (>= 2)
Description: A fast and flexible implementation of Callaway and Sant'Anna's (2021)<https://www.sciencedirect.com/science/article/pii/S0304407620303948> staggered Difference-in-Differences (DiD) estimators and its extensions, fastdid reduces the computation time from hours to seconds, and incorporates extensions such as time-varying covariates and multiple events.
License: MIT + file LICENSE
Imports:
data.table,
stringr,
BMisc,
collapse,
dreamerr (>= 1.4.0),
parglm
Suggests: ggplot2, did
parglm,
ggplot2
Suggests:
did,
knitr,
parallel,
rmarkdown,
tinytest
Encoding: UTF-8
RoxygenNote: 7.3.2
URL: https://github.com/TsaiLintung/fastdid, https://tsailintung.github.io/fastdid/
BugReports: https://github.com/TsaiLintung/fastdid/issues
VignetteBuilder: knitr
2 changes: 2 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
YEAR: 2024
COPYRIGHT HOLDER: fastdid authors
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# MIT License

Copyright (c) 2024 fastdid authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
8 changes: 6 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@
export(fastdid)
export(plot_did_dynamics)
export(sim_did)
import(BMisc)
import(data.table)
import(dreamerr)
import(parglm)
import(ggplot2)
import(stringr)
importFrom(BMisc,multiplier_bootstrap)
importFrom(collapse,allNA)
importFrom(collapse,fnrow)
importFrom(collapse,fnunique)
importFrom(collapse,fsum)
importFrom(collapse,na_insert)
importFrom(collapse,whichNA)
importFrom(parallel,mclapply)
importFrom(parglm,parglm.control)
importFrom(parglm,parglm.fit)
importFrom(stats,as.formula)
importFrom(stats,binomial)
importFrom(stats,fitted)
Expand All @@ -22,3 +25,4 @@ importFrom(stats,quantile)
importFrom(stats,rnorm)
importFrom(stats,sd)
importFrom(stats,vcov)
importFrom(stats,weighted.mean)
40 changes: 40 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 0.9.9 (2024/9/1)

- add double did (see the vignette for the introduction)
- add `parallel`, parallization for unix systems, useful if the number of g-t is large.
- add `full`, return full result such as influence function, aggregate scheme, and such
- add `min`/`max_dynamic`, `custom_scheme` to experimental features

# 0.9.4 (2024/8/2)

> [!WARNING]
> Some BREAKING change is introduced in this update.

- add uniform confidence interval option with `cband` and significance level `alpha`, confidence interval are now provided in result as column `att_ciub` and `att_cilb`
- BREAKING: `filtervar`, `max_control_cohort_diff`, `min_control_cohort_diff` are moved into the experimental features. See the above section for the explanation.
- add `max_dynamic` and `min_dynamic` as experimental features.
- more informative error message when estimation fails for a specific `gt`, some internal interface overhaul

# 0.9.3 (2024/5/7)

- add anticipation and varying base period option
- add min and max control cohort difference
- add time-varying control ([reference](https://arxiv.org/abs/2202.02903))
- add filtervar

0.9.3.1 (2024/5/24): fix the bug with `univar == clustervar` (TODO: address problems with name-changing and collision).
0.9.3.2 (2024/7/17): fix group_time result when using `control_type = "notyet"` and make the base period in plots adapt to anticipation.
0.9.3.3 (2024/7/22): fix anticipation out of bound problem, more permanent solution for group_time target problem

# 0.9.2 (2023/12/20)

- add support to doubly robust and outcome regression estimators
- add support to unbalanced panels (simple and ipw only)
- add support to balanced composition option in dynamics aggregation
- fixed argument checking that was not working properly
- set the default to copying the entire dataset to avoid unexpected modification of the original data (thanks @grantmcdermott for the suggestion.)

# 0.9.1 (2023/10/20)

- now supprts estimation for multiple outcomes in one go!
- data validation: no longer check missing values for columns not used.
Loading
Loading