Skip to content

Commit 721876a

Browse files
committed
✨ Initial commit
0 parents  commit 721876a

60 files changed

Lines changed: 2075 additions & 0 deletions

Some content is hidden

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

.Rbuildignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
^didimputation\.Rproj$
2+
^\.Rproj\.user$
3+
^_pkgdown\.yml$
4+
^docs$
5+
^pkgdown$
6+
^LICENSE\.md$
7+
^README\.Rmd$
8+
^\.github$
9+
^codecov\.yml$

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.github/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.html

.github/workflows/R-CMD-check.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
2+
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
pull_request:
9+
branches:
10+
- main
11+
- master
12+
13+
name: R-CMD-check
14+
15+
jobs:
16+
R-CMD-check:
17+
runs-on: macOS-latest
18+
env:
19+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
20+
steps:
21+
- uses: actions/checkout@v2
22+
- uses: r-lib/actions/setup-r@v1
23+
- name: Install dependencies
24+
run: |
25+
install.packages(c("remotes", "rcmdcheck"))
26+
remotes::install_deps(dependencies = TRUE)
27+
shell: Rscript {0}
28+
- name: Check
29+
run: |
30+
options(crayon.enabled = TRUE)
31+
rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error")
32+
shell: Rscript {0}

.github/workflows/pkgdown.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
- master
6+
tags:
7+
-'*'
8+
9+
name: pkgdown
10+
11+
jobs:
12+
pkgdown:
13+
runs-on: macOS-latest
14+
env:
15+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
16+
steps:
17+
- uses: actions/checkout@v2
18+
19+
- uses: r-lib/actions/setup-r@v1
20+
21+
- uses: r-lib/actions/setup-pandoc@v1
22+
23+
- name: Query dependencies
24+
run: |
25+
install.packages('remotes')
26+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
27+
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
28+
shell: Rscript {0}
29+
30+
- name: Restore R package cache
31+
uses: actions/cache@v2
32+
with:
33+
path: ${{ env.R_LIBS_USER }}
34+
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
35+
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
36+
37+
- name: Install dependencies
38+
run: |
39+
remotes::install_deps(dependencies = TRUE)
40+
install.packages("pkgdown", type = "binary")
41+
shell: Rscript {0}
42+
43+
- name: Install package
44+
run: R CMD INSTALL .
45+
46+
- name: Deploy package
47+
run: |
48+
git config --local user.email "actions@github.com"
49+
git config --local user.name "GitHub Actions"
50+
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
- master
6+
pull_request:
7+
branches:
8+
- main
9+
- master
10+
11+
name: test-coverage
12+
13+
jobs:
14+
test-coverage:
15+
runs-on: macOS-latest
16+
env:
17+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
18+
steps:
19+
- uses: actions/checkout@v2
20+
21+
- uses: r-lib/actions/setup-r@v1
22+
23+
- uses: r-lib/actions/setup-pandoc@v1
24+
25+
- name: Query dependencies
26+
run: |
27+
install.packages('remotes')
28+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
29+
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
30+
shell: Rscript {0}
31+
32+
- name: Restore R package cache
33+
uses: actions/cache@v2
34+
with:
35+
path: ${{ env.R_LIBS_USER }}
36+
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
37+
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
38+
39+
- name: Install dependencies
40+
run: |
41+
install.packages(c("remotes"))
42+
remotes::install_deps(dependencies = TRUE)
43+
remotes::install_cran("covr")
44+
shell: Rscript {0}
45+
46+
- name: Test coverage
47+
run: covr::codecov()
48+
shell: Rscript {0}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.Rproj.user
2+
docs
3+
inst/doc
4+
/test_script.R
5+
.Rhistory

DESCRIPTION

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
Package: didImputation
2+
Title: Staggered difference-in-differences estimation
3+
Version: 0.0.1.0
4+
Authors@R: c(
5+
person(given = "Antoine",
6+
family = "Mayerowitz",
7+
role = c("aut", "cre"),
8+
email = "a.mayerowitz@gmailcom"),
9+
person(given = "Maxime",
10+
family = "Gravoueille",
11+
role = c("aut"),
12+
email = "maximegravoueille@gmailcom"))
13+
Description: Set of functions to estimate, report and visualize results in staggered difference-in-differences (DiD) setup using the imputation approach of Borusyak, Jaravel, and Spiess (2021). The standard DiD setup involves two periods and two groups (one treated and one untreated), it relies on parallel trend assumption to estimate the treatment effect of the treated. The staggered DiD setup is the generalization of this approach to multiple periods and multiple groups (i.e. individuals treated at different time periods.). Recent literature stress out the need to not use the standard two-way fixed effect (TWFE) regression to estimate those models. This package implements a method of imputation to estimate the average treatment effect. The package uses untreated observations to predict the counterfactual outcome on treated observations and provide the appropriate Standard errors. It provides ways to test for parallel trends.
14+
Depends:
15+
R (>= 3.5),
16+
License: MIT + file LICENSE
17+
Encoding: UTF-8
18+
LazyData: true
19+
Roxygen: list(markdown = TRUE)
20+
RoxygenNote: 7.1.1
21+
Suggests:
22+
markdown,
23+
knitr,
24+
rmarkdown,
25+
testthat (>= 3.0.0),
26+
covr,
27+
badger,
28+
Config/testthat/edition: 3
29+
Imports:
30+
data.table,
31+
ggplot2,
32+
fixest (>= 0.9),
33+
collapse,
34+
rlang,
35+
purrr,
36+
stats
37+
VignetteBuilder: knitr

LICENSE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
YEAR: 2021
2+
COPYRIGHT HOLDER: Antoine Mayerowitz, Maxime Gravoueille

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# MIT License
2+
3+
Copyright (c) 2021 Antoine Mayerowitz, Maxime Gravoueille
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.

0 commit comments

Comments
 (0)