Skip to content

Commit 18d8b03

Browse files
authored
Merge pull request #11 from TsaiLintung/double
0.9.9 (Double)
2 parents f35622a + c0ddddd commit 18d8b03

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+3112
-1856
lines changed

.DS_Store

6 KB
Binary file not shown.

.Rbuildignore

+5
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@
55
^development
66

77
^\.github$
8+
^cran-comments\.md$
9+
^LICENSE\.md$
10+
^_pkgdown\.yml$
11+
^docs$
12+
^pkgdown$

.github/workflows/pkgdown.yaml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
release:
9+
types: [published]
10+
workflow_dispatch:
11+
12+
name: pkgdown.yaml
13+
14+
permissions: read-all
15+
16+
jobs:
17+
pkgdown:
18+
runs-on: ubuntu-latest
19+
# Only restrict concurrency for non-PR jobs
20+
concurrency:
21+
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
22+
env:
23+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
24+
permissions:
25+
contents: write
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- uses: r-lib/actions/setup-pandoc@v2
30+
31+
- uses: r-lib/actions/setup-r@v2
32+
with:
33+
use-public-rspm: true
34+
35+
- uses: r-lib/actions/setup-r-dependencies@v2
36+
with:
37+
extra-packages: any::pkgdown, local::.
38+
needs: website
39+
40+
- name: Build site
41+
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
42+
shell: Rscript {0}
43+
44+
- name: Deploy to GitHub pages 🚀
45+
if: github.event_name != 'pull_request'
46+
uses: JamesIves/[email protected]
47+
with:
48+
clean: false
49+
branch: gh-pages
50+
folder: docs

.github/workflows/test-coverage.yaml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Run tests and upload coverage
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
9+
jobs:
10+
test:
11+
name: Run tests and collect coverage
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Set up Node
20+
uses: actions/setup-node@v4
21+
22+
- name: Install dependencies
23+
run: npm install
24+
25+
- name: Run tests
26+
run: npx jest --coverage
27+
28+
- name: Upload results to Codecov
29+
uses: codecov/codecov-action@v4
30+
with:
31+
token: ${{ secrets.CODECOV_TOKEN }}

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,6 @@ vignettes/*.pdf
3737

3838
#interactive stuff
3939
*development/old
40-
*development/output
40+
*development/output
41+
docs
42+
inst/doc

DESCRIPTION

+19-10
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,37 @@
11
Package: fastdid
22
Type: Package
3-
Title: lightning-fast staggered Difference-in-Difference estimators
4-
Version: 0.9.4
5-
Date: 2024-08-05
3+
Title: Fast Staggered Difference-in-Difference Estimators
4+
Version: 0.9.9
5+
Date: 2024-09-08
66
Authors@R: c(
77
person("Lin-Tung","Tsai",
8-
role = c("aut", "cre"),
8+
role = c("aut", "cre", "cph"),
99
email = "[email protected]"),
1010
person(given = "Maxwell",
1111
family = "Kellogg", ,
12-
role = "aut"),
12+
role = "ctb"),
1313
person(given = "Kuan-Ju",
1414
family = "Tseng", ,
15-
role = "aut"))
15+
role = "ctb"))
1616
Maintainer: Lin-Tung Tsai <[email protected]>
17-
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.
18-
License: GPL (>= 2)
17+
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.
18+
License: MIT + file LICENSE
1919
Imports:
2020
data.table,
2121
stringr,
2222
BMisc,
2323
collapse,
2424
dreamerr (>= 1.4.0),
25-
parglm
26-
Suggests: ggplot2, did
25+
parglm,
26+
ggplot2
27+
Suggests:
28+
did,
29+
knitr,
30+
parallel,
31+
rmarkdown,
32+
tinytest
2733
Encoding: UTF-8
2834
RoxygenNote: 7.3.2
35+
URL: https://github.com/TsaiLintung/fastdid, https://tsailintung.github.io/fastdid/
36+
BugReports: https://github.com/TsaiLintung/fastdid/issues
37+
VignetteBuilder: knitr

LICENSE

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
YEAR: 2024
2+
COPYRIGHT HOLDER: fastdid authors

LICENSE.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# MIT License
2+
3+
Copyright (c) 2024 fastdid authors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

NAMESPACE

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,20 @@
33
export(fastdid)
44
export(plot_did_dynamics)
55
export(sim_did)
6-
import(BMisc)
76
import(data.table)
87
import(dreamerr)
9-
import(parglm)
8+
import(ggplot2)
109
import(stringr)
10+
importFrom(BMisc,multiplier_bootstrap)
1111
importFrom(collapse,allNA)
1212
importFrom(collapse,fnrow)
1313
importFrom(collapse,fnunique)
1414
importFrom(collapse,fsum)
1515
importFrom(collapse,na_insert)
1616
importFrom(collapse,whichNA)
17+
importFrom(parallel,mclapply)
18+
importFrom(parglm,parglm.control)
19+
importFrom(parglm,parglm.fit)
1720
importFrom(stats,as.formula)
1821
importFrom(stats,binomial)
1922
importFrom(stats,fitted)
@@ -22,3 +25,4 @@ importFrom(stats,quantile)
2225
importFrom(stats,rnorm)
2326
importFrom(stats,sd)
2427
importFrom(stats,vcov)
28+
importFrom(stats,weighted.mean)

NEWS.md

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# 0.9.9 (2024/9/1)
2+
3+
- add double did (see the vignette for the introduction)
4+
- add `parallel`, parallization for unix systems, useful if the number of g-t is large.
5+
- add `full`, return full result such as influence function, aggregate scheme, and such
6+
- add `min`/`max_dynamic`, `custom_scheme` to experimental features
7+
8+
# 0.9.4 (2024/8/2)
9+
10+
> [!WARNING]
11+
> Some BREAKING change is introduced in this update.
12+
13+
- 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`
14+
- BREAKING: `filtervar`, `max_control_cohort_diff`, `min_control_cohort_diff` are moved into the experimental features. See the above section for the explanation.
15+
- add `max_dynamic` and `min_dynamic` as experimental features.
16+
- more informative error message when estimation fails for a specific `gt`, some internal interface overhaul
17+
18+
# 0.9.3 (2024/5/7)
19+
20+
- add anticipation and varying base period option
21+
- add min and max control cohort difference
22+
- add time-varying control ([reference](https://arxiv.org/abs/2202.02903))
23+
- add filtervar
24+
25+
0.9.3.1 (2024/5/24): fix the bug with `univar == clustervar` (TODO: address problems with name-changing and collision).
26+
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.
27+
0.9.3.3 (2024/7/22): fix anticipation out of bound problem, more permanent solution for group_time target problem
28+
29+
# 0.9.2 (2023/12/20)
30+
31+
- add support to doubly robust and outcome regression estimators
32+
- add support to unbalanced panels (simple and ipw only)
33+
- add support to balanced composition option in dynamics aggregation
34+
- fixed argument checking that was not working properly
35+
- set the default to copying the entire dataset to avoid unexpected modification of the original data (thanks @grantmcdermott for the suggestion.)
36+
37+
# 0.9.1 (2023/10/20)
38+
39+
- now supprts estimation for multiple outcomes in one go!
40+
- data validation: no longer check missing values for columns not used.

0 commit comments

Comments
 (0)