diff --git a/.github/workflows/update-citation.yml b/.github/workflows/update-citation.yml index cca7c8e..724c0d0 100644 --- a/.github/workflows/update-citation.yml +++ b/.github/workflows/update-citation.yml @@ -25,11 +25,28 @@ jobs: run: | Rscript -e ' library(desc); - d <- desc::desc_get(); - citation_text <- sprintf("citHeader(\"To cite this package, use:\")\n\nbibentry(\n bibtype = \"Manual\",\n title = \"%s\",\n author = %s,\n year = \"%s\",\n note = \"R package version %s\",\n url = \"%s\"\n)", - d["Title"], d["Authors@R"], format(Sys.Date(), "%Y"), d["Version"], d["URL"]); + # Read package metadata + package_title <- desc::desc_get("Title") + authors <- desc::desc_get("Authors@R") + version <- desc::desc_get("Version") + url <- desc::desc_get("URL") + year <- format(Sys.Date(), "%Y") # Get current year + + # Generate citation content dynamically + citation_text <- sprintf("citHeader(\"To cite this package, use:\")\n\n + bibentry(\n + bibtype = \"Manual\",\n + title = \"%s\",\n + author = %s,\n + year = \"%s\",\n + note = \"R package version %s\",\n + url = \"%s\" + )", package_title, authors, year, version, url) + + # Write the updated citation file writeLines(citation_text, "inst/CITATION")' + - name: Update CITATION.cff run: | Rscript -e 'cffr::cff_write()' diff --git a/CITATION.cff b/CITATION.cff index b2b8280..2464f4e 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -4,11 +4,11 @@ # -------------------------------------------- cff-version: 1.2.0 -message: 'To cite package "pte" in publications use:' +message: 'To cite package "ptetools" in publications use:' type: software license: GPL-3.0-only -title: 'pte: Panel Treatment Effects' -version: 0.0.0.9000 +title: 'ptetools: Panel Treatment Effects Tools' +version: 1.0.0 abstract: This is fairly generic code for estimating treatment effects with panel data. This is useful code in my own work and will perhaps be useful to others. It builds heavily on the \codedid package. In particular, it breaks into separate steps @@ -21,8 +21,18 @@ authors: - family-names: Callaway given-names: Brantly email: brantly.callaway@uga.edu -repository-code: https://github.com/bcallaway11/pte -url: https://github.com/bcallaway11/pte +preferred-citation: + type: manual + title: Panel Treatment Effects Tools + authors: + - family-names: Callaway + given-names: Brantly + email: brantly.callaway@uga.edu + year: '2025' + notes: R package version 1.0.0 + url: https://github.com/bcallaway11/ptetools +repository-code: https://github.com/bcallaway11/ptetools +url: https://github.com/bcallaway11/ptetools contact: - family-names: Callaway given-names: Brantly @@ -41,12 +51,12 @@ references: email: brantly.callaway@uga.edu year: '2025' doi: 10.32614/CRAN.package.BMisc - version: '>= 1.4.1' + version: '>= 1.4.7' - type: software title: Matrix abstract: 'Matrix: Sparse and Dense Matrix Classes and Methods' notes: Imports - url: https://R-forge.R-project.org/tracker/?atid=294&group_id=61 + url: https://Matrix.R-forge.R-project.org repository: https://CRAN.R-project.org/package=Matrix authors: - family-names: Bates @@ -61,22 +71,6 @@ references: orcid: https://orcid.org/0000-0002-3542-2938 year: '2025' doi: 10.32614/CRAN.package.Matrix -- type: software - title: did - abstract: 'did: Treatment Effects with Multiple Periods and Groups' - notes: Imports - url: https://bcallaway11.github.io/did/ - repository: https://CRAN.R-project.org/package=did - authors: - - family-names: Callaway - given-names: Brantly - email: brantly.callaway@uga.edu - - family-names: Sant'Anna - given-names: Pedro H. C. - email: pedro.h.santanna@vanderbilt.edu - year: '2025' - doi: 10.32614/CRAN.package.did - version: '>= 2.0.0' - type: software title: ggplot2 abstract: 'ggplot2: Create Elegant Data Visualisations Using the Grammar of Graphics' diff --git a/DESCRIPTION b/DESCRIPTION index 33195cf..83637e8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -7,6 +7,7 @@ Authors@R: role = c("aut", "cre"), email = "brantly.callaway@uga.edu") URL: https://github.com/bcallaway11/ptetools +BugReports: https://github.com/bcallaway11/ptetools/issues Description: This is fairly generic code for estimating treatment effects with panel data. This is useful code in my own work and will perhaps be useful to others. It builds heavily on the \code{did} package. In particular, it breaks into separate steps organizing the data, looping over groups and time periods, computing group-time average treatment effects, and aggregating group-time average treatment effects. Often, one is able to implement a new identification/estimation procedure by simply replacing the step on estimating group-time average treatment effects. See several different examples of this approach in the README. License: GPL-3 Encoding: UTF-8 diff --git a/README.Rmd b/README.Rmd index 123f3a3..963946d 100644 --- a/README.Rmd +++ b/README.Rmd @@ -8,7 +8,9 @@ output: github_document knitr::opts_chunk$set( collapse = TRUE, comment = "#>", - fig.path = "man/figures/README-" + fig.path = "man/figures/README-", + warning = FALSE, + message = FALSE ) ``` diff --git a/README.md b/README.md index 4c3500d..3ce9fd4 100644 --- a/README.md +++ b/README.md @@ -84,50 +84,23 @@ did_res <- pte( attgt_fun = did_attgt, xformla = ~lpop ) -#> Warning in pte(yname = "lemp", gname = "first.treat", tname = "year", idname = "countyreal", : 'pte' is deprecated. -#> Use 'pte2' instead. -#> See help("Deprecated") -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal summary(did_res) #> #> Overall ATT: #> ATT Std. Error [ 95% Conf. Int.] -#> -0.0323 0.0135 -0.0587 -0.0058 * +#> -0.0323 0.0146 -0.0609 -0.0036 * #> #> #> Dynamic Effects: #> Event Time Estimate Std. Error [95% Conf. Band] -#> -3 0.0269 0.0112 -0.0053 0.0591 -#> -2 -0.0050 0.0126 -0.0413 0.0313 -#> -1 -0.0229 0.0124 -0.0584 0.0127 -#> 0 -0.0201 0.0139 -0.0602 0.0199 -#> 1 -0.0547 0.0173 -0.1046 -0.0049 * -#> 2 -0.1382 0.0337 -0.2350 -0.0414 * -#> 3 -0.1069 0.0340 -0.2046 -0.0092 * +#> -3 0.0269 0.0141 -0.0106 0.0645 +#> -2 -0.0050 0.0148 -0.0444 0.0345 +#> -1 -0.0229 0.0137 -0.0595 0.0138 +#> 0 -0.0201 0.0115 -0.0508 0.0105 +#> 1 -0.0547 0.0187 -0.1046 -0.0048 * +#> 2 -0.1382 0.0389 -0.2421 -0.0343 * +#> 3 -0.1069 0.0415 -0.2177 0.0039 #> --- #> Signif. codes: `*' confidence band does not cover 0 ggpte(did_res) @@ -176,135 +149,48 @@ covid_res <- pte( max_e = 21, min_e = -10 ) -#> Warning in pte(yname = "positive", gname = "group", tname = "time.period", : 'pte' is deprecated. -#> Use 'pte2' instead. -#> See help("Deprecated") -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal summary(covid_res) #> #> Overall ATT: #> ATT Std. Error [ 95% Conf. Int.] -#> 14.8882 89.2491 -160.0369 189.8132 +#> 14.8882 72.9644 -128.1195 157.8958 #> #> #> Dynamic Effects: -#> Event Time Estimate Std. Error [95% Conf. Band] -#> -10 -3.7266 4.0893 -13.5376 6.0843 -#> -9 2.6607 1.4131 -0.7295 6.0508 -#> -8 0.8290 2.1182 -4.2528 5.9107 -#> -7 5.2843 2.0558 0.3523 10.2164 * -#> -6 2.8555 2.3030 -2.6698 8.3808 -#> -5 1.3589 4.0842 -8.4397 11.1575 -#> -4 0.3294 3.4489 -7.9451 8.6039 -#> -3 -4.2227 4.6681 -15.4221 6.9768 -#> -2 -3.8447 2.9548 -10.9336 3.2441 -#> -1 -0.2234 3.4588 -8.5214 8.0747 -#> 0 -10.8156 8.4755 -31.1497 9.5184 -#> 1 -13.7998 12.9474 -44.8626 17.2630 -#> 2 -7.8432 9.9894 -31.8092 16.1228 -#> 3 -4.5541 8.6319 -25.2634 16.1552 -#> 4 -3.5368 11.3025 -30.6532 23.5795 -#> 5 8.5221 12.1537 -20.6363 37.6805 -#> 6 1.1140 17.0145 -39.7064 41.9343 -#> 7 6.6384 15.9018 -31.5122 44.7891 -#> 8 7.1288 25.9489 -55.1264 69.3840 -#> 9 10.8758 33.4554 -69.3886 91.1403 -#> 10 17.5057 30.2446 -55.0556 90.0670 -#> 11 40.8318 35.3309 -43.9323 125.5959 -#> 12 48.6134 45.3943 -60.2943 157.5210 -#> 13 52.4228 59.6057 -90.5799 195.4255 -#> 14 50.2000 55.9394 -84.0068 184.4068 -#> 15 68.2960 67.1875 -92.8965 229.4885 -#> 16 44.7305 67.4749 -117.1516 206.6126 -#> 17 61.4670 82.0294 -135.3336 258.2675 -#> 18 50.4635 104.0203 -199.0964 300.0234 -#> 19 47.3392 129.1065 -262.4062 357.0845 -#> 20 28.6326 109.0253 -232.9351 290.2003 -#> 21 4.3445 129.9741 -307.4822 316.1713 +#> Event Time Estimate Std. Error [95% Conf. Band] +#> -10 -3.7266 3.4720 -13.7679 6.3146 +#> -9 2.6607 1.3600 -1.2726 6.5940 +#> -8 0.8290 2.4227 -6.1776 7.8355 +#> -7 5.2843 2.3046 -1.3807 11.9494 +#> -6 2.8555 1.6024 -1.7788 7.4899 +#> -5 1.3589 3.9788 -10.1479 12.8658 +#> -4 0.3294 3.4291 -9.5876 10.2464 +#> -3 -4.2227 4.6652 -17.7146 9.2693 +#> -2 -3.8447 3.0287 -12.6037 4.9143 +#> -1 -0.2234 3.6485 -10.7751 10.3283 +#> 0 -10.8156 9.1745 -37.3486 15.7174 +#> 1 -13.7998 13.8403 -53.8266 26.2270 +#> 2 -7.8432 11.4608 -40.9882 25.3019 +#> 3 -4.5541 7.8721 -27.3206 18.2123 +#> 4 -3.5368 10.4098 -33.6426 26.5689 +#> 5 8.5221 11.6292 -25.1102 42.1544 +#> 6 1.1140 16.7373 -47.2910 49.5190 +#> 7 6.6384 18.6669 -47.3471 60.6240 +#> 8 7.1288 24.3691 -63.3478 77.6054 +#> 9 10.8758 22.1689 -53.2377 74.9893 +#> 10 17.5057 31.9608 -74.9265 109.9379 +#> 11 40.8318 44.0803 -86.6506 168.3141 +#> 12 48.6134 45.2290 -82.1910 179.4178 +#> 13 52.4228 66.3735 -139.5323 244.3779 +#> 14 50.2000 52.6136 -101.9610 202.3610 +#> 15 68.2960 65.5323 -121.2266 257.8186 +#> 16 44.7305 76.4396 -176.3363 265.7973 +#> 17 61.4670 83.4622 -179.9097 302.8436 +#> 18 50.4635 116.1918 -285.5687 386.4957 +#> 19 47.3392 108.3272 -265.9482 360.6266 +#> 20 28.6326 148.0358 -399.4937 456.7589 +#> 21 4.3445 142.9397 -409.0438 417.7328 #> --- #> Signif. codes: `*' confidence band does not cover 0 ggpte(covid_res) + ylim(c(-1000, 1000)) @@ -364,26 +250,23 @@ did_res_noif <- pte( attgt_fun = did_attgt_noif, # this is only diff. xformla = ~lpop ) -#> Warning in pte(yname = "lemp", gname = "first.treat", tname = "year", idname = "countyreal", : 'pte' is deprecated. -#> Use 'pte2' instead. -#> See help("Deprecated") summary(did_res_noif) #> #> Overall ATT: #> ATT Std. Error [ 95% Conf. Int.] -#> -0.0323 0.0125 -0.0568 -0.0077 * +#> -0.0323 0.0112 -0.0542 -0.0103 * #> #> #> Dynamic Effects: #> Event Time Estimate Std. Error [95% Pointwise Conf. Band] -#> -3 0.0269 0.0140 -0.0005 0.0544 -#> -2 -0.0050 0.0131 -0.0307 0.0208 -#> -1 -0.0229 0.0155 -0.0531 0.0074 -#> 0 -0.0201 0.0123 -0.0442 0.0039 -#> 1 -0.0547 0.0170 -0.0881 -0.0214 * -#> 2 -0.1382 0.0335 -0.2039 -0.0725 * -#> 3 -0.1069 0.0344 -0.1744 -0.0394 * +#> -3 0.0269 0.0158 -0.0040 0.0578 +#> -2 -0.0050 0.0116 -0.0277 0.0178 +#> -1 -0.0229 0.0131 -0.0485 0.0028 +#> 0 -0.0201 0.0112 -0.0421 0.0018 +#> 1 -0.0547 0.0161 -0.0864 -0.0231 * +#> 2 -0.1382 0.0364 -0.2095 -0.0669 * +#> 3 -0.1069 0.0346 -0.1747 -0.0391 * #> --- #> Signif. codes: `*' confidence band does not cover 0 ggpte(did_res_noif) diff --git a/_pkgdown.yml b/_pkgdown.yml index c6c7a31..84af843 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,4 +1,4 @@ -url: https://bcallaway11.github.io/ptetools +url: https://github.com/bcallaway11/ptetools template: bootstrap: 5 diff --git a/docs/404.html b/docs/404.html index efcc0ac..a97392b 100644 --- a/docs/404.html +++ b/docs/404.html @@ -4,104 +4,74 @@ - + Page not found (404) • ptetools - - - - - - - - - - - - - - + + + + + + + + + + + + - - - -
-
-
- Content not found. Please use links in the navbar. -
- - - +
- -
- diff --git a/docs/authors.html b/docs/authors.html index 4840919..56b8208 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -1,91 +1,71 @@ -Authors and Citation • ptetools - - -
-
-
-
- +
+
+
+
+
+

Authors

  • Brantly Callaway. Author, maintainer.

-
-
-

Citation

- Source: DESCRIPTION -
-
+
+

Citation

+

Source: inst/CITATION

-

Callaway B (2025). -ptetools: Panel Treatment Effects Tools. -R package version 0.0.1, https://github.com/bcallaway11/pte. +

Callaway B (2025). +Panel Treatment Effects Tools. +R package version 1.0.0, https://github.com/bcallaway11/ptetools.

-
@Manual{,
-  title = {ptetools: Panel Treatment Effects Tools},
+      
@Manual{,
+  title = {Panel Treatment Effects Tools},
   author = {Brantly Callaway},
   year = {2025},
-  note = {R package version 0.0.1},
-  url = {https://github.com/bcallaway11/pte},
+  note = {R package version 1.0.0},
+  url = {https://github.com/bcallaway11/ptetools},
 }
+
-
- -
- +
-
- +
diff --git a/docs/index.html b/docs/index.html index 7dcd9e6..8fc7d4d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4,7 +4,7 @@ - + Panel Treatment Effects Tools • ptetools @@ -12,70 +12,52 @@ - - - - - - + + + + + + - - + - + + Skip to contents -
-
-
-
- +
+
+
+
+

The ptetools package compartmentalizes the steps needed to implement estimators of group-time average treatment effects (and their aggregations) in order to make it easier to apply the same sorts of arguments outside of their “birthplace” in the literature on difference-in-differences.

This code is lightweight, only works for balanced panels, and has minimal error checking. That said, it should be useful projects that build on top of group-time average treatment effects in order to deliver estimates of causal effects in panel data settings.

The main function is called pte. The most important paramters that it takes in are subset_fun and attgt_fun. These are functions that the user should pass to pte.

-

subset_fun takes in the overall data, a group, a time period, and possibly other arguments and returns a data.frame containing the relevant subset of the data, an outcome, and whether or not a unit should be considered to be in the treated or comparison group for that group/time. There is one example of a relevant subset function provided in the package: the two_by_two_subset function. This function takes an original dataset, subsets it into pre- and post-treatment periods and denotes treated and untreated units. This particular subset is perhaps the most common/important one for thinking about treatment effects with panel data.

+

subset_fun takes in the overall data, a group, a time period, and possibly other arguments and returns a data.frame containing the relevant subset of the data, an outcome, and whether or not a unit should be considered to be in the treated or comparison group for that group/time. There is one example of a relevant subset function provided in the package: the two_by_two_subset function. This function takes an original dataset, subsets it into pre- and post-treatment periods and denotes treated and untreated units. This particular subset is perhaps the most common/important one for thinking about treatment effects with panel data.

The other main function is attgt_fun. This function should be able to take in the correct subset of data, possibly along with other arguments to the function, and report an ATT for that subset. With minor modification, this function should be availble for most any sort of treatment effects application — for example, if you can solve the baseline 2x2 case in difference in differences, you should use that function here, and the ptetools package will take care of dealing with the variation in treatment timing.

If attgt_fun returns an influence function, then the ptetools package will also conduct inference using the multiplier bootstrap (which is fast) and produce uniform confidence bands (which adjust for multiple testing).

The default output of pte is an overall treatment effect on the treated (i.e., across all groups that participate in the treatment in any time period) and dynamic effects (i.e., event studies). More aggregations are possible, but these seem to be the leading cases; aggregations of group-time average treatment effects are discussed at length in Callaway and Sant’Anna (2021).

@@ -99,55 +81,28 @@

Example 1: Difference in difference attgt_fun = did_attgt, xformla = ~lpop ) -#> Warning in pte(yname = "lemp", gname = "first.treat", tname = "year", idname = "countyreal", : 'pte' is deprecated. -#> Use 'pte2' instead. -#> See help("Deprecated") -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal summary(did_res) #> #> Overall ATT: #> ATT Std. Error [ 95% Conf. Int.] -#> -0.0323 0.0135 -0.0587 -0.0058 * +#> -0.0323 0.0146 -0.0609 -0.0036 * #> #> #> Dynamic Effects: #> Event Time Estimate Std. Error [95% Conf. Band] -#> -3 0.0269 0.0112 -0.0053 0.0591 -#> -2 -0.0050 0.0126 -0.0413 0.0313 -#> -1 -0.0229 0.0124 -0.0584 0.0127 -#> 0 -0.0201 0.0139 -0.0602 0.0199 -#> 1 -0.0547 0.0173 -0.1046 -0.0049 * -#> 2 -0.1382 0.0337 -0.2350 -0.0414 * -#> 3 -0.1069 0.0340 -0.2046 -0.0092 * +#> -3 0.0269 0.0141 -0.0106 0.0645 +#> -2 -0.0050 0.0148 -0.0444 0.0345 +#> -1 -0.0229 0.0137 -0.0595 0.0138 +#> 0 -0.0201 0.0115 -0.0508 0.0105 +#> 1 -0.0547 0.0187 -0.1046 -0.0048 * +#> 2 -0.1382 0.0389 -0.2421 -0.0343 * +#> 3 -0.1069 0.0415 -0.2177 0.0039 #> --- #> Signif. codes: `*' confidence band does not cover 0 ggpte(did_res)

-

What’s most interesting here, is that the only “new” code that needs to be writte is in the did_attgt function. You will see that this is a very small amount of code.

+

What’s most interesting here, is that the only “new” code that needs to be writte is in the did_attgt function. You will see that this is a very small amount of code.

Example 2: Policy Evaluation during a Pandemic @@ -172,135 +127,48 @@

Example 2: Policy Evaluat max_e = 21, min_e = -10 ) -#> Warning in pte(yname = "positive", gname = "group", tname = "time.period", : 'pte' is deprecated. -#> Use 'pte2' instead. -#> See help("Deprecated") -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal -#> Warning in mboot2(thisinffunc, biters = biters, alp = alp): critical value for uniform confidence band is somehow smaller than -#> critical value for pointwise confidence interval...using pointwise -#> confidence interal summary(covid_res) #> #> Overall ATT: #> ATT Std. Error [ 95% Conf. Int.] -#> 14.8882 89.2491 -160.0369 189.8132 +#> 14.8882 72.9644 -128.1195 157.8958 #> #> #> Dynamic Effects: -#> Event Time Estimate Std. Error [95% Conf. Band] -#> -10 -3.7266 4.0893 -13.5376 6.0843 -#> -9 2.6607 1.4131 -0.7295 6.0508 -#> -8 0.8290 2.1182 -4.2528 5.9107 -#> -7 5.2843 2.0558 0.3523 10.2164 * -#> -6 2.8555 2.3030 -2.6698 8.3808 -#> -5 1.3589 4.0842 -8.4397 11.1575 -#> -4 0.3294 3.4489 -7.9451 8.6039 -#> -3 -4.2227 4.6681 -15.4221 6.9768 -#> -2 -3.8447 2.9548 -10.9336 3.2441 -#> -1 -0.2234 3.4588 -8.5214 8.0747 -#> 0 -10.8156 8.4755 -31.1497 9.5184 -#> 1 -13.7998 12.9474 -44.8626 17.2630 -#> 2 -7.8432 9.9894 -31.8092 16.1228 -#> 3 -4.5541 8.6319 -25.2634 16.1552 -#> 4 -3.5368 11.3025 -30.6532 23.5795 -#> 5 8.5221 12.1537 -20.6363 37.6805 -#> 6 1.1140 17.0145 -39.7064 41.9343 -#> 7 6.6384 15.9018 -31.5122 44.7891 -#> 8 7.1288 25.9489 -55.1264 69.3840 -#> 9 10.8758 33.4554 -69.3886 91.1403 -#> 10 17.5057 30.2446 -55.0556 90.0670 -#> 11 40.8318 35.3309 -43.9323 125.5959 -#> 12 48.6134 45.3943 -60.2943 157.5210 -#> 13 52.4228 59.6057 -90.5799 195.4255 -#> 14 50.2000 55.9394 -84.0068 184.4068 -#> 15 68.2960 67.1875 -92.8965 229.4885 -#> 16 44.7305 67.4749 -117.1516 206.6126 -#> 17 61.4670 82.0294 -135.3336 258.2675 -#> 18 50.4635 104.0203 -199.0964 300.0234 -#> 19 47.3392 129.1065 -262.4062 357.0845 -#> 20 28.6326 109.0253 -232.9351 290.2003 -#> 21 4.3445 129.9741 -307.4822 316.1713 +#> Event Time Estimate Std. Error [95% Conf. Band] +#> -10 -3.7266 3.4720 -13.7679 6.3146 +#> -9 2.6607 1.3600 -1.2726 6.5940 +#> -8 0.8290 2.4227 -6.1776 7.8355 +#> -7 5.2843 2.3046 -1.3807 11.9494 +#> -6 2.8555 1.6024 -1.7788 7.4899 +#> -5 1.3589 3.9788 -10.1479 12.8658 +#> -4 0.3294 3.4291 -9.5876 10.2464 +#> -3 -4.2227 4.6652 -17.7146 9.2693 +#> -2 -3.8447 3.0287 -12.6037 4.9143 +#> -1 -0.2234 3.6485 -10.7751 10.3283 +#> 0 -10.8156 9.1745 -37.3486 15.7174 +#> 1 -13.7998 13.8403 -53.8266 26.2270 +#> 2 -7.8432 11.4608 -40.9882 25.3019 +#> 3 -4.5541 7.8721 -27.3206 18.2123 +#> 4 -3.5368 10.4098 -33.6426 26.5689 +#> 5 8.5221 11.6292 -25.1102 42.1544 +#> 6 1.1140 16.7373 -47.2910 49.5190 +#> 7 6.6384 18.6669 -47.3471 60.6240 +#> 8 7.1288 24.3691 -63.3478 77.6054 +#> 9 10.8758 22.1689 -53.2377 74.9893 +#> 10 17.5057 31.9608 -74.9265 109.9379 +#> 11 40.8318 44.0803 -86.6506 168.3141 +#> 12 48.6134 45.2290 -82.1910 179.4178 +#> 13 52.4228 66.3735 -139.5323 244.3779 +#> 14 50.2000 52.6136 -101.9610 202.3610 +#> 15 68.2960 65.5323 -121.2266 257.8186 +#> 16 44.7305 76.4396 -176.3363 265.7973 +#> 17 61.4670 83.4622 -179.9097 302.8436 +#> 18 50.4635 116.1918 -285.5687 386.4957 +#> 19 47.3392 108.3272 -265.9482 360.6266 +#> 20 28.6326 148.0358 -399.4937 456.7589 +#> 21 4.3445 142.9397 -409.0438 417.7328 #> --- #> Signif. codes: `*' confidence band does not cover 0 ggpte(covid_res) + ylim(c(-1000, 1000))

@@ -337,26 +205,23 @@

Example 3: Empirical Bootstrap= did_attgt_noif, # this is only diff. xformla = ~lpop ) -#> Warning in pte(yname = "lemp", gname = "first.treat", tname = "year", idname = "countyreal", : 'pte' is deprecated. -#> Use 'pte2' instead. -#> See help("Deprecated") summary(did_res_noif) #> #> Overall ATT: #> ATT Std. Error [ 95% Conf. Int.] -#> -0.0323 0.0125 -0.0568 -0.0077 * +#> -0.0323 0.0112 -0.0542 -0.0103 * #> #> #> Dynamic Effects: #> Event Time Estimate Std. Error [95% Pointwise Conf. Band] -#> -3 0.0269 0.0140 -0.0005 0.0544 -#> -2 -0.0050 0.0131 -0.0307 0.0208 -#> -1 -0.0229 0.0155 -0.0531 0.0074 -#> 0 -0.0201 0.0123 -0.0442 0.0039 -#> 1 -0.0547 0.0170 -0.0881 -0.0214 * -#> 2 -0.1382 0.0335 -0.2039 -0.0725 * -#> 3 -0.1069 0.0344 -0.1744 -0.0394 * +#> -3 0.0269 0.0158 -0.0040 0.0578 +#> -2 -0.0050 0.0116 -0.0277 0.0178 +#> -1 -0.0229 0.0131 -0.0485 0.0028 +#> 0 -0.0201 0.0112 -0.0421 0.0018 +#> 1 -0.0547 0.0161 -0.0864 -0.0231 * +#> 2 -0.1382 0.0364 -0.2095 -0.0669 * +#> 3 -0.1069 0.0346 -0.1747 -0.0391 * #> --- #> Signif. codes: `*' confidence band does not cover 0 ggpte(did_res_noif)

@@ -364,13 +229,11 @@

Example 3: Empirical Bootstrap - +

-
- diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index af6f6b3..7f62c3d 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -2,7 +2,7 @@ pandoc: 3.1.3 pkgdown: 2.1.0 pkgdown_sha: ~ articles: {} -last_built: 2025-01-31T15:29Z +last_built: 2025-01-31T16:05Z urls: - reference: https://bcallaway11.github.io/ptetools/reference - article: https://bcallaway11.github.io/ptetools/articles + reference: https://github.com/bcallaway11/ptetools/reference + article: https://github.com/bcallaway11/ptetools/articles diff --git a/docs/reference/aggte_obj.html b/docs/reference/aggte_obj.html index f1e9f58..83cf4e8 100644 --- a/docs/reference/aggte_obj.html +++ b/docs/reference/aggte_obj.html @@ -1,61 +1,49 @@ -aggte_obj — aggte_obj • ptetoolsaggte_obj — aggte_obj • ptetools - - -
-
-
- +
+
+
-
+

Objects of this class hold results on aggregated group-time average treatment effects. This is derived from the AGGTEobj class in the did package.

An object for holding aggregated treatment effect parameters.

-
+
+

Usage

aggte_obj(
   overall.att = NULL,
   overall.se = NULL,
@@ -73,8 +61,8 @@ 

aggte_obj

)
-
-

Arguments

+
+

Arguments

overall.att
@@ -113,28 +101,24 @@

Arguments

A DIDparams object

-
-

Value

+
+

Value

an aggte_obj

-
- -
+
-
- +
diff --git a/docs/reference/attgt_if.html b/docs/reference/attgt_if.html index 1ee3317..031a61b 100644 --- a/docs/reference/attgt_if.html +++ b/docs/reference/attgt_if.html @@ -1,62 +1,48 @@ -attgt_if — attgt_if • ptetools - - -
-
-
- +
+
+
-
+

Class for holding group-time average treatment effects along with their influence function

-
+
+

Usage

attgt_if(attgt, inf_func, extra_gt_returns = NULL)
-
-

Arguments

+
+

Arguments

attgt
@@ -76,28 +62,24 @@

Arguments

potentially useful for debugging.

-
-

Value

+
+

Value

attgt_if object

-
- -
+
-
- +
diff --git a/docs/reference/attgt_noif.html b/docs/reference/attgt_noif.html index 68d9347..ce3cda7 100644 --- a/docs/reference/attgt_noif.html +++ b/docs/reference/attgt_noif.html @@ -1,62 +1,48 @@ -attgt_noif — attgt_noif • ptetools - - -
-
-
- +
+
+
-
+

Class for holding group-time average treatment effects which don't include influence functions

-
+
+

Usage

attgt_noif(attgt, extra_gt_returns = NULL)
-
-

Arguments

+
+

Arguments

attgt
@@ -72,28 +58,24 @@

Arguments

potentially useful for debugging.

-
-

Value

+
+

Value

attgt_noif object

-
- -
+
-
- +
diff --git a/docs/reference/attgt_pte_aggregations.html b/docs/reference/attgt_pte_aggregations.html index 8bd0f13..5d37b79 100644 --- a/docs/reference/attgt_pte_aggregations.html +++ b/docs/reference/attgt_pte_aggregations.html @@ -1,66 +1,54 @@ -attgt_pte_aggregations — attgt_pte_aggregations • ptetoolsattgt_pte_aggregations — attgt_pte_aggregations • ptetools - - -
-
-
- +
+
+
-
+

Aggregate group-time average treatment effects into overall, group, and dynamic effects. This function is only used for (i) computing standard errors using the empirical bootstrap, and (ii) combining distributions at the (g,t) level

-
+
+

Usage

attgt_pte_aggregations(attgt.list, ptep)
-
-

Arguments

+
+

Arguments

attgt.list
@@ -71,28 +59,24 @@

Arguments

pte_params object

-
-

Value

+
+

Value

pte_emp_boot object

-
- -
+
-
- +
diff --git a/docs/reference/compute.pte.html b/docs/reference/compute.pte.html index 6c98b08..4a748fd 100644 --- a/docs/reference/compute.pte.html +++ b/docs/reference/compute.pte.html @@ -1,60 +1,45 @@ -compute.pte — compute.pte • ptetools - - -
-
-
- +
+
+
-
+

Function that actually computes panel treatment effects

-
+
+

Usage

compute.pte(ptep, subset_fun, attgt_fun, ...)
-
-

Arguments

+
+

Arguments

ptep
@@ -107,28 +92,24 @@

Arguments

max_e, and balance_e arguments to event study aggregations)

-
-

Value

+
+

Value

list of attgt results and, sometimes, and influence function

-
- -
+
-
- +
diff --git a/docs/reference/compute.pte2.html b/docs/reference/compute.pte2.html index 59f2648..85ef3ac 100644 --- a/docs/reference/compute.pte2.html +++ b/docs/reference/compute.pte2.html @@ -1,66 +1,54 @@ -compute.pte2 — compute.pte2 • ptetoolscompute.pte2 — compute.pte2 • ptetools - - -
-
-
- +
+
+
-
+

Function that actually computes panel treatment effects. The difference relative to compute.pte is that this function loops over time periods first (instead of groups) and tries to estimate model for untreated potential outcomes jointly for all groups.

-
+
+

Usage

compute.pte2(ptep, subset_fun, attgt_fun, ...)
-
-

Arguments

+
+

Arguments

ptep
@@ -113,28 +101,24 @@

Arguments

max_e, and balance_e arguments to event study aggregations)

-
-

Value

+
+

Value

list of attgt results and, sometimes, an influence function

-
- -
+
-
- +
diff --git a/docs/reference/crit_val_checks.html b/docs/reference/crit_val_checks.html index da8c46e..928be90 100644 --- a/docs/reference/crit_val_checks.html +++ b/docs/reference/crit_val_checks.html @@ -1,62 +1,48 @@ -crit_val_checks — crit_val_checks • ptetools - - -
-
-
- +
+
+
-
+

A function to perform sanity checks and possibly adjust a a critical value to form a uniform confidence band

-
+
+

Usage

crit_val_checks(crit_val, alp = 0.05)
-
-

Arguments

+
+

Arguments

crit_val
@@ -67,28 +53,24 @@

Arguments

the significance level

-
-

Value

+
+

Value

a (possibly adjusted) critical value

-
- -
+
-
- +
diff --git a/docs/reference/did_attgt.html b/docs/reference/did_attgt.html index b2f6f70..216b153 100644 --- a/docs/reference/did_attgt.html +++ b/docs/reference/did_attgt.html @@ -1,5 +1,5 @@ -did_attgt — did_attgt • ptetools - - -
-
-
- +
+
+
-
+

Takes a "local" data.frame and computes an estimate of a group time average treatment effect and a corresponding influence function using a difference in differences @@ -69,12 +63,13 @@

did_attgt

data to have this format before the call to did_attgt.

-
+
+

Usage

did_attgt(gt_data, xformla, ...)
-
-

Arguments

+
+

Arguments

gt_data
@@ -91,28 +86,24 @@

Arguments

extra function arguments; not used here

-
-

Value

+
+

Value

attgt_if

-
- -
+
-
- +
diff --git a/docs/reference/dose_obj.html b/docs/reference/dose_obj.html index e3106f0..c2005bd 100644 --- a/docs/reference/dose_obj.html +++ b/docs/reference/dose_obj.html @@ -1,57 +1,43 @@ -dose_obj — dose_obj • ptetools - - -
-
-
- +
+
+
-
+

Holds results from computing dose-specific treatment effects with a continuous treatment

-
+
+

Usage

dose_obj(
   dose,
   att.d = NULL,
@@ -67,8 +53,8 @@ 

dose_obj

)
-
-

Arguments

+
+

Arguments

dose
@@ -120,28 +106,24 @@

Arguments

interval for ACRT(d)

-
-

Value

+
+

Value

dose_obj

-
- -
+
-
- +
diff --git a/docs/reference/figures/README-unnamed-chunk-3-1.png b/docs/reference/figures/README-unnamed-chunk-3-1.png index b03ab79..e444852 100644 Binary files a/docs/reference/figures/README-unnamed-chunk-3-1.png and b/docs/reference/figures/README-unnamed-chunk-3-1.png differ diff --git a/docs/reference/figures/README-unnamed-chunk-6-1.png b/docs/reference/figures/README-unnamed-chunk-6-1.png index 64ad405..179287c 100644 Binary files a/docs/reference/figures/README-unnamed-chunk-6-1.png and b/docs/reference/figures/README-unnamed-chunk-6-1.png differ diff --git a/docs/reference/figures/README-unnamed-chunk-8-1.png b/docs/reference/figures/README-unnamed-chunk-8-1.png index c241cb0..1c76508 100644 Binary files a/docs/reference/figures/README-unnamed-chunk-8-1.png and b/docs/reference/figures/README-unnamed-chunk-8-1.png differ diff --git a/docs/reference/getSE.html b/docs/reference/getSE.html index 51cecc2..53aaa23 100644 --- a/docs/reference/getSE.html +++ b/docs/reference/getSE.html @@ -1,90 +1,72 @@ -Take influence function and return standard errors — getSE • ptetools - - -
-
-
- +
+
+
-
+

Function to take an nx1 influence function and return a standard error

-
+
+

Usage

getSE(thisinffunc, bstrap = TRUE, biters = 100, alp = 0.05)
-
-

Arguments

+
+

Arguments

thisinffunc

An influence function

-
-

Value

+
+

Value

scalar standard error

-
- -
+
-
- +
diff --git a/docs/reference/get_agg_inf_func.html b/docs/reference/get_agg_inf_func.html index 3daab69..bd7a0d0 100644 --- a/docs/reference/get_agg_inf_func.html +++ b/docs/reference/get_agg_inf_func.html @@ -1,66 +1,54 @@ -Get an influence function for particular aggregate parameters — get_agg_inf_func • ptetoolsGet an influence function for particular aggregate parameters — get_agg_inf_func • ptetools - - -
-
-
- +
+
+
-
+

Get an influence function for particular aggregate parameters

This is a generic internal function for combining influence functions across ATT(g,t)'s to return an influence function for various aggregated treatment effect parameters.

-
+
+

Usage

get_agg_inf_func(att, inffunc1, whichones, weights.agg, wif = NULL)
-
-

Arguments

+
+

Arguments

att
@@ -87,28 +75,24 @@

Arguments

should be n x k matrix where k is dimension of whichones

-
-

Value

+
+

Value

nx1 influence function

-
- -
+
-
- +
diff --git a/docs/reference/ggpte.html b/docs/reference/ggpte.html index 058e616..b4bd411 100644 --- a/docs/reference/ggpte.html +++ b/docs/reference/ggpte.html @@ -1,60 +1,45 @@ -ggpte — ggpte • ptetools - - -
-
-
- +
+
+
-
+

Simple event study plots for panel treatment effects

-
+
+

Usage

ggpte(pte_results)
-
-

Arguments

+
+

Arguments

pte_results
@@ -62,23 +47,19 @@

Arguments

-
- -
+
-
- +
diff --git a/docs/reference/ggpte_cont.html b/docs/reference/ggpte_cont.html index 2e20dd7..8bf62d9 100644 --- a/docs/reference/ggpte_cont.html +++ b/docs/reference/ggpte_cont.html @@ -1,60 +1,45 @@ -ggpte_cont — ggpte_cont • ptetools - - -
-
-
- +
+
+
-
+

a function for plotting results in applications with a continuous treatment

-
+
+

Usage

ggpte_cont(dose_obj, type = "att")
-
-

Arguments

+
+

Arguments

dose_obj
@@ -67,23 +52,19 @@

Arguments

-
- -
+
-
- +
diff --git a/docs/reference/group_time_att.html b/docs/reference/group_time_att.html index b48becd..c9a9f47 100644 --- a/docs/reference/group_time_att.html +++ b/docs/reference/group_time_att.html @@ -1,55 +1,40 @@ -group_time_att — group_time_att • ptetools - - -
-
-
- +
+
+
-
+

group_time_att class

-
+
+

Usage

group_time_att(
   group,
   time.period,
@@ -68,8 +53,8 @@ 

group_time_att

)
-
-

Arguments

+
+

Arguments

group
@@ -132,28 +117,24 @@

Arguments

list containing extra returns at the group-time level

-
-

Value

+
+

Value

object of class group_time_att

-
- -
+
-
- +
diff --git a/docs/reference/gt_data_frame.html b/docs/reference/gt_data_frame.html index 5af931a..834717d 100644 --- a/docs/reference/gt_data_frame.html +++ b/docs/reference/gt_data_frame.html @@ -1,64 +1,51 @@ -gt_data_frame — gt_data_frame • ptetoolsgt_data_frame — gt_data_frame • ptetools - - -
-
-
- +
+
+
-
+

function to take in a data.frame, check if it has the right columns to be used to calculate a group-time average treatment effect, and sets the class of the data.frame to include gt_data_frame

-
+
+

Usage

gt_data_frame(data)
-
-

Arguments

+
+

Arguments

data
@@ -66,28 +53,24 @@

Arguments

computing group-time average treatment effects

-
-

Value

+
+

Value

gt_data_frame object

-
- -
+
-
- +
diff --git a/docs/reference/index.html b/docs/reference/index.html index 8c3a531..15a7928 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -1,238 +1,308 @@ -Package index • ptetools - - -
-
-
- +
+
+
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

All functions

-

-
-

aggte_obj()

-

aggte_obj

-

attgt_if()

-

attgt_if

-

attgt_noif()

-

attgt_noif

-

attgt_pte_aggregations()

-

attgt_pte_aggregations

-

compute.pte()

-

compute.pte

-

compute.pte2()

-

compute.pte2

-

crit_val_checks()

-

crit_val_checks

-

did_attgt()

-

did_attgt

-

dose_obj()

-

dose_obj

-

ggpte()

-

ggpte

-

ggpte_cont()

-

ggpte_cont

-

group_time_att()

-

group_time_att

-

gt_data_frame()

-

gt_data_frame

-

keep_all_pretreatment_subset()

-

keep_all_pretreatment_subset

-

keep_all_untreated_subset()

-

keep_all_untreated_subset

-

mboot2()

-

mboot2

-

overall_weights()

-

overall_weights

-

panel_empirical_bootstrap()

-

panel_empirical_bootstrap

-

print(<group_time_att>)

-

print.group_time_att

-

print(<pte_results>)

-

print.pte_results

-

print(<summary.dose_obj>)

-

print.summary.dose_obj

-

print(<summary.pte_results>)

-

print.summary.pte_results

-

process_att_gt()

-

process_att_gt

-

pte()

-

Panel Treatment Effects

-

pte2()

-

pte2

-

pte_aggte()

-

pte_aggte

-

pte_attgt()

-

pte_attgt

-

pte_default()

-

pte_default

-

pte_dose_results()

-

pte_dose_results

-

pte_emp_boot()

-

pte_emp_boot

-

pte_params()

-

pte_params

-

pte_results()

-

pte_results

-

qott_pte_aggregations()

-

qott_pte_aggregations

-

qtt_pte_aggregations()

-

qtt_pte_aggregations

-

setup_pte()

-

Setup panel treatment effects parameters

-

setup_pte_basic()

-

Example setup panel treatment effects parameters

-

summary(<aggte_obj>)

-

Summary Aggregate Treatment Effect Parameter Objects

-

summary(<dose_obj>)

-

summary.dose_obj

-

summary(<group_time_att>)

-

summary.group_time_att

-

summary(<pte_emp_boot>)

-

summary.pte_emp_boot

-

summary(<pte_results>)

-

summary.pte_results

-

two_by_two_subset()

-

two_by_two_subset

- - -
+
+

All functions

-
+ + +
-
+ +
diff --git a/docs/reference/keep_all_pretreatment_subset.html b/docs/reference/keep_all_pretreatment_subset.html index 3aeca02..532755c 100644 --- a/docs/reference/keep_all_pretreatment_subset.html +++ b/docs/reference/keep_all_pretreatment_subset.html @@ -1,57 +1,47 @@ -keep_all_pretreatment_subset — keep_all_pretreatment_subset • ptetoolskeep_all_pretreatment_subset — keep_all_pretreatment_subset • ptetools - - -
-
+ ptetools + 1.0.0 -
-
- +
+
+
-
+

A function that takes an original data set and keeps all data for all groups that are not-yet-treated by period tp as well as for group g.

@@ -61,12 +51,13 @@

keep_all_pretreatment_subset

proposed in Callaway and Tsyawo (2023).

-
+
+

Usage

keep_all_pretreatment_subset(data, g, tp, ...)
-
-

Arguments

+
+

Arguments

data
@@ -85,28 +76,24 @@

Arguments

additional arguments

-
-

Value

+
+

Value

all data but in correct format for computing ATT(g,t)

-
- -
+
-
- +
diff --git a/docs/reference/keep_all_untreated_subset.html b/docs/reference/keep_all_untreated_subset.html index b1f69d0..c8f0740 100644 --- a/docs/reference/keep_all_untreated_subset.html +++ b/docs/reference/keep_all_untreated_subset.html @@ -1,5 +1,5 @@ -keep_all_untreated_subset — keep_all_untreated_subset • ptetoolskeep_all_untreated_subset — keep_all_untreated_subset • ptetools - - -
-
+
-
- +
+
+
-
+

A function that takes an original data set and keeps all pre-treatment data for all groups. For group g, it also includes data for the current period.

@@ -65,12 +57,13 @@

keep_all_untreated_subset

estimation strategy such as imputation in Gardner (2022).

-
+
+

Usage

keep_all_untreated_subset(data, g, tp, ...)
-
-

Arguments

+
+

Arguments

data
@@ -89,28 +82,24 @@

Arguments

extra arguments to get the subset correct

-
-

Value

+
+

Value

all data but in correct format for computing ATT(g,t)

-
- -
+
-
- +
diff --git a/docs/reference/mboot2.html b/docs/reference/mboot2.html index 6a2e43a..34f6aaf 100644 --- a/docs/reference/mboot2.html +++ b/docs/reference/mboot2.html @@ -1,62 +1,48 @@ -mboot2 — mboot2 • ptetools - - -
-
-
- +
+
+
-
+

function for using multiplier bootstrap to conduct inference

-
+
+

Usage

mboot2(inffunc, biters = 1000, alp = 0.05)
-
-

Arguments

+
+

Arguments

inffunc
@@ -72,23 +58,19 @@

Arguments

-
- -
+
-
- +
diff --git a/docs/reference/overall_weights.html b/docs/reference/overall_weights.html index 8ff2dbd..362ef04 100644 --- a/docs/reference/overall_weights.html +++ b/docs/reference/overall_weights.html @@ -1,92 +1,74 @@ -overall_weights — overall_weights • ptetools - - -
-
-
- +
+
+
-
+

A function that returns weights on gt's to deliver overall (averaged across groups and time periods) treatment effect parameters

-
+
+

Usage

overall_weights(attgt, balance_e = NULL, min_e = -Inf, max_e = Inf, ...)
-
-

Arguments

+
+

Arguments

attgt

A group_time_att object to be aggregated

-
-

Value

+
+

Value

a data.frame with columns containing the group, the time period and the amount of weight that it should get for an overall treatment effect parameter

-
- -
+
-
- +
diff --git a/docs/reference/panel_empirical_bootstrap.html b/docs/reference/panel_empirical_bootstrap.html index ab5f399..d1fc3ab 100644 --- a/docs/reference/panel_empirical_bootstrap.html +++ b/docs/reference/panel_empirical_bootstrap.html @@ -1,55 +1,40 @@ -panel_empirical_bootstrap — panel_empirical_bootstrap • ptetools - - -
-
-
- +
+
+
-
+

Computes empirical bootstrap pointwise standard errors

-
+
+

Usage

panel_empirical_bootstrap(
   attgt.list,
   ptep,
@@ -61,8 +46,8 @@ 

panel_empirical_bootstrap

)
-
-

Arguments

+
+

Arguments

attgt.list
@@ -154,28 +139,24 @@

Arguments

max_e, and balance_e arguments to event study aggregations)

-
-

Value

+
+

Value

pte_emp_boot object

-
- -
+
-
- +
diff --git a/docs/reference/print.group_time_att.html b/docs/reference/print.group_time_att.html index 49d3ed3..1374ee9 100644 --- a/docs/reference/print.group_time_att.html +++ b/docs/reference/print.group_time_att.html @@ -1,61 +1,46 @@ -print.group_time_att — print.group_time_att • ptetools - - -
-
-
- +
+
+
-
+

prints value of a group_time_att object

-
+
+

Usage

# S3 method for class 'group_time_att'
 print(x, ...)
-
-

Arguments

+
+

Arguments

x
@@ -67,23 +52,19 @@

Arguments

-
- -
+
-
- +
diff --git a/docs/reference/print.pte_results.html b/docs/reference/print.pte_results.html index c2ce115..cb946a4 100644 --- a/docs/reference/print.pte_results.html +++ b/docs/reference/print.pte_results.html @@ -1,61 +1,46 @@ -print.pte_results — print.pte_results • ptetools - - -
-
-
- +
+
+
-
+

prints value of a pte_results object

-
+
+

Usage

# S3 method for class 'pte_results'
 print(x, ...)
-
-

Arguments

+
+

Arguments

x
@@ -67,23 +52,19 @@

Arguments

-
- -
+
-
- +
diff --git a/docs/reference/print.summary.dose_obj.html b/docs/reference/print.summary.dose_obj.html index fde6c0d..a6a6e66 100644 --- a/docs/reference/print.summary.dose_obj.html +++ b/docs/reference/print.summary.dose_obj.html @@ -1,61 +1,46 @@ -print.summary.dose_obj — print.summary.dose_obj • ptetools - - -
-
-
- +
+
+
-
+

prints a summary of a dose_obj object

-
+
+

Usage

# S3 method for class 'summary.dose_obj'
 print(x, ...)
-
-

Arguments

+
+

Arguments

x
@@ -67,23 +52,19 @@

Arguments

-
- -
+
-
- +
diff --git a/docs/reference/print.summary.pte_results.html b/docs/reference/print.summary.pte_results.html index ff0d23d..61da374 100644 --- a/docs/reference/print.summary.pte_results.html +++ b/docs/reference/print.summary.pte_results.html @@ -1,61 +1,46 @@ -print.summary.pte_results — print.summary.pte_results • ptetools - - -
-
-
- +
+
+
-
+

prints value of a summary.pte_results object

-
+
+

Usage

# S3 method for class 'summary.pte_results'
 print(x, ...)
-
-

Arguments

+
+

Arguments

x
@@ -67,23 +52,19 @@

Arguments

-
- -
+
-
- +
diff --git a/docs/reference/process_att_gt.html b/docs/reference/process_att_gt.html index 41e0734..e38b8ce 100644 --- a/docs/reference/process_att_gt.html +++ b/docs/reference/process_att_gt.html @@ -1,60 +1,45 @@ -process_att_gt — process_att_gt • ptetools - - -
-
-
- +
+
+
-
+

process attgt results when influence function is available

-
+
+

Usage

process_att_gt(att_gt_results, ptep)
-
-

Arguments

+
+

Arguments

att_gt_results
@@ -66,23 +51,19 @@

Arguments

-
- -
+
-
- +
diff --git a/docs/reference/pte.html b/docs/reference/pte.html index e26bb4a..5ee32ce 100644 --- a/docs/reference/pte.html +++ b/docs/reference/pte.html @@ -1,57 +1,43 @@ -Panel Treatment Effects — pte • ptetools - - -
-
-
- +
+
+
-
+

Tools for estimating treatment effects with panel data.

Main function for computing panel treatment effects

-
+
+

Usage

pte(
   yname,
   gname,
@@ -73,8 +59,8 @@ 

Panel Treatment Effects

)
-
-

Arguments

+
+

Arguments

yname
@@ -216,37 +202,34 @@

Arguments

max_e, and balance_e arguments to event study aggregations)

-
-

Value

+
+

Value

pte_results object

-
-

See also

-

Useful links:

+
-
- +
diff --git a/docs/reference/pte2.html b/docs/reference/pte2.html index 83038c7..0896c70 100644 --- a/docs/reference/pte2.html +++ b/docs/reference/pte2.html @@ -1,55 +1,40 @@ -pte2 — pte2 • ptetools - - -
-
-
- +
+
+
-
+

Main function for computing panel treatment effects

-
+
+

Usage

pte2(
   yname,
   gname,
@@ -76,8 +61,8 @@ 

pte2

)
-
-

Arguments

+
+

Arguments

yname
@@ -249,28 +234,24 @@

Arguments

return. This is unused except in cases where the results involve doses.

-
-

Value

+
+

Value

pte_results object

-
- -
+
-
- +
diff --git a/docs/reference/pte_aggte.html b/docs/reference/pte_aggte.html index 3452257..3285a2b 100644 --- a/docs/reference/pte_aggte.html +++ b/docs/reference/pte_aggte.html @@ -1,57 +1,47 @@ -pte_aggte — pte_aggte • ptetools - - -
-
+ ptetools + 1.0.0 -
-
- +
+
+
-
+

This is a slight edit of the aggte function from the did package. Currently, it only provides aggregations for "overall" treatment effects and event studies. It also will provide the weights directly which is @@ -61,7 +51,8 @@

pte_aggte

assignment nor from the covariates).

-
+
+

Usage

pte_aggte(
   attgt,
   type = "overall",
@@ -72,8 +63,8 @@ 

pte_aggte

)
-
-

Arguments

+
+

Arguments

attgt
@@ -85,23 +76,19 @@

Arguments

-
- -
+
-
- +
diff --git a/docs/reference/pte_attgt.html b/docs/reference/pte_attgt.html index 3975240..0ceb2df 100644 --- a/docs/reference/pte_attgt.html +++ b/docs/reference/pte_attgt.html @@ -1,5 +1,5 @@ -pte_attgt — pte_attgt • ptetools - - -
-
-
- +
+
+
-
+

pte_attgt takes a "local" data.frame and computes an estimate of a group time average treatment effect and a corresponding influence function. This function generalizes @@ -69,7 +63,8 @@

pte_attgt

data to have this format before the call to pte_attgt

-
+
+

Usage

pte_attgt(
   gt_data,
   xformla,
@@ -81,8 +76,8 @@ 

pte_attgt

)
-
-

Arguments

+
+

Arguments

gt_data
@@ -120,28 +115,24 @@

Arguments

extra function arguments; not used here

-
-

Value

+
+

Value

attgt_if

-
- -
+
-
- +
diff --git a/docs/reference/pte_default.html b/docs/reference/pte_default.html index aa13baa..efb9323 100644 --- a/docs/reference/pte_default.html +++ b/docs/reference/pte_default.html @@ -1,61 +1,49 @@ -pte_default — pte_default • ptetoolspte_default — pte_default • ptetools - - -
-
-
- +
+
+
-
+

This is a generic/example wrapper for a call to the pte function.

This function provides access to difference-in-differences and unconfoundedness based identification/estimation strategies given (i) panel data and (ii) staggered treatment adoption

-
+
+

Usage

pte_default(
   yname,
   gname,
@@ -79,8 +67,8 @@ 

pte_default

)
-
-

Arguments

+
+

Arguments

yname
@@ -184,28 +172,24 @@

Arguments

number of clusters to be used when bootstrapping; default is 1

-
-

Value

+
+

Value

pte_results object

-
- -
+
-
- +
diff --git a/docs/reference/pte_dose_results.html b/docs/reference/pte_dose_results.html index b79af8c..ee4fe41 100644 --- a/docs/reference/pte_dose_results.html +++ b/docs/reference/pte_dose_results.html @@ -1,60 +1,45 @@ -pte_dose_results — pte_dose_results • ptetools - - -
-
-
- +
+
+
-
+

class for holding pte results

-
+
+

Usage

pte_dose_results(att_gt, dose, att_d = NULL, acrt_d = NULL, ptep)
-
-

Arguments

+
+

Arguments

att_gt
@@ -74,23 +59,19 @@

Arguments

-
- -
+
-
- +
diff --git a/docs/reference/pte_emp_boot.html b/docs/reference/pte_emp_boot.html index f4f1b50..dfae9f8 100644 --- a/docs/reference/pte_emp_boot.html +++ b/docs/reference/pte_emp_boot.html @@ -1,57 +1,43 @@ -pte_emp_boot — pte_emp_boot • ptetools - - -
-
-
- +
+
+
-
+

pte_emp_boot

Class for holding pte empirical bootstrap results

-
+
+

Usage

pte_emp_boot(
   attgt_results,
   overall_results,
@@ -64,8 +50,8 @@ 

pte_emp_boot

)
-
-

Arguments

+
+

Arguments

attgt_results
@@ -109,28 +95,24 @@

Arguments

potentially useful for debugging.

-
-

Value

+
+

Value

pte_emp_boot object

-
- -
+
-
- +
diff --git a/docs/reference/pte_params.html b/docs/reference/pte_params.html index 3861113..1e6929a 100644 --- a/docs/reference/pte_params.html +++ b/docs/reference/pte_params.html @@ -1,55 +1,40 @@ -pte_params — pte_params • ptetools - - -
-
-
- +
+
+
-
+

Objects that contain pte parameters

-
+
+

Usage

pte_params(
   yname,
   gname,
@@ -75,8 +60,8 @@ 

pte_params

)
-
-

Arguments

+
+

Arguments

yname
@@ -189,23 +174,19 @@

Arguments

-
- -
+
-
- +
diff --git a/docs/reference/pte_results.html b/docs/reference/pte_results.html index f5f75af..4249755 100644 --- a/docs/reference/pte_results.html +++ b/docs/reference/pte_results.html @@ -1,60 +1,45 @@ -pte_results — pte_results • ptetools - - -
-
-
- +
+
+
-
+

class for holding pte results

-
+
+

Usage

pte_results(att_gt, overall_att, event_study, ptep)
-
-

Arguments

+
+

Arguments

att_gt
@@ -74,23 +59,19 @@

Arguments

-
- -
+
-
- +
diff --git a/docs/reference/qott_pte_aggregations.html b/docs/reference/qott_pte_aggregations.html index 1e286a8..b737d72 100644 --- a/docs/reference/qott_pte_aggregations.html +++ b/docs/reference/qott_pte_aggregations.html @@ -1,62 +1,48 @@ -qott_pte_aggregations — qott_pte_aggregations • ptetools - - -
-
-
- +
+
+
-
+

Aggregate group-time distribution of the treatment effect into overall, group, and dynamic effects.

-
+
+

Usage

qott_pte_aggregations(attgt.list, ptep, extra_gt_returns)
-
-

Arguments

+
+

Arguments

attgt.list
@@ -76,28 +62,24 @@

Arguments

potentially useful for debugging.

-
-

Value

+
+

Value

pte_emp_boot object

-
- -
+
-
- +
diff --git a/docs/reference/qtt_pte_aggregations.html b/docs/reference/qtt_pte_aggregations.html index 20ab383..849c165 100644 --- a/docs/reference/qtt_pte_aggregations.html +++ b/docs/reference/qtt_pte_aggregations.html @@ -1,62 +1,48 @@ -qtt_pte_aggregations — qtt_pte_aggregations • ptetools - - -
-
-
- +
+
+
-
+

Aggregate group-time distributions into qtt versions of overall, group, and dynamic effects.

-
+
+

Usage

qtt_pte_aggregations(attgt.list, ptep, extra_gt_returns)
-
-

Arguments

+
+

Arguments

attgt.list
@@ -76,28 +62,24 @@

Arguments

potentially useful for debugging.

-
-

Value

+
+

Value

pte_emp_boot object

-
- -
+
-
- +
diff --git a/docs/reference/setup_pte.html b/docs/reference/setup_pte.html index 4c09213..02f2797 100644 --- a/docs/reference/setup_pte.html +++ b/docs/reference/setup_pte.html @@ -1,56 +1,45 @@ -Setup panel treatment effects parameters — setup_pte • ptetoolsSetup panel treatment effects parameters — setup_pte • ptetools - - -
-
-
- +
+
+
-
+

This is a function for how to setup the data to be used in the pte package.

The setup_pte function builds on setup_pte_basic and @@ -59,7 +48,8 @@

Setup panel treatment effects parameters

and attgt_fun in the next steps.

-
+
+

Usage

setup_pte(
   yname,
   gname,
@@ -81,8 +71,8 @@ 

Setup panel treatment effects parameters

)
-
-

Arguments

+
+

Arguments

yname
@@ -169,28 +159,24 @@

Arguments

additional arguments

-
-

Value

+
+

Value

pte_params object

-
- -
+
-
- +
diff --git a/docs/reference/setup_pte_basic.html b/docs/reference/setup_pte_basic.html index 9366f8a..7683ff9 100644 --- a/docs/reference/setup_pte_basic.html +++ b/docs/reference/setup_pte_basic.html @@ -1,5 +1,5 @@ -Example setup panel treatment effects parameters — setup_pte_basic • ptetoolsExample setup panel treatment effects parameters — setup_pte_basic • ptetools - - -
-
-
- +
+
+
-
+

This is a lightweight (example) function for how to setup the data to be used in the pte package.

setup_pte_basic takes in information about the structure of data @@ -79,7 +78,8 @@

Example setup panel treatment effects parameters

that the data is in the correct format, etc.

-
+
+

Usage

setup_pte_basic(
   yname,
   gname,
@@ -97,8 +97,8 @@ 

Example setup panel treatment effects parameters

)
-
-

Arguments

+
+

Arguments

yname
@@ -158,28 +158,24 @@

Arguments

additional arguments

-
-

Value

+
+

Value

pte_params object

-
- -
+
-
- +
diff --git a/docs/reference/summary.aggte_obj.html b/docs/reference/summary.aggte_obj.html index cb2b8c7..3a77d27 100644 --- a/docs/reference/summary.aggte_obj.html +++ b/docs/reference/summary.aggte_obj.html @@ -1,61 +1,46 @@ -Summary Aggregate Treatment Effect Parameter Objects — summary.aggte_obj • ptetools - - -
-
-
- +
+
+
-
+

A function to summarize aggregated treatment effect parameters.

-
+
+

Usage

# S3 method for class 'aggte_obj'
 summary(object, ...)
-
-

Arguments

+
+

Arguments

object
@@ -67,23 +52,19 @@

Arguments

-
- -
+
-
- +
diff --git a/docs/reference/summary.dose_obj.html b/docs/reference/summary.dose_obj.html index a25a8dc..681533d 100644 --- a/docs/reference/summary.dose_obj.html +++ b/docs/reference/summary.dose_obj.html @@ -1,61 +1,46 @@ -summary.dose_obj — summary.dose_obj • ptetools - - -
-
-
- +
+
+
-
+

summarizes a dose_obj object

-
+
+

Usage

# S3 method for class 'dose_obj'
 summary(object, ...)
-
-

Arguments

+
+

Arguments

object
@@ -67,23 +52,19 @@

Arguments

-
- -
+
-
- +
diff --git a/docs/reference/summary.group_time_att.html b/docs/reference/summary.group_time_att.html index 2bfd22e..2517026 100644 --- a/docs/reference/summary.group_time_att.html +++ b/docs/reference/summary.group_time_att.html @@ -1,61 +1,46 @@ -summary.group_time_att — summary.group_time_att • ptetools - - -
-
-
- +
+
+
-
+

prints a summary of a group_time_att object

-
+
+

Usage

# S3 method for class 'group_time_att'
 summary(object, ...)
-
-

Arguments

+
+

Arguments

object
@@ -67,23 +52,19 @@

Arguments

-
- -
+
-
- +
diff --git a/docs/reference/summary.pte_emp_boot.html b/docs/reference/summary.pte_emp_boot.html index 7789192..c352cfc 100644 --- a/docs/reference/summary.pte_emp_boot.html +++ b/docs/reference/summary.pte_emp_boot.html @@ -1,61 +1,46 @@ -summary.pte_emp_boot — summary.pte_emp_boot • ptetools - - -
-
-
- +
+
+
-
+

Summary for pte_emp_boot object

-
+
+

Usage

# S3 method for class 'pte_emp_boot'
 summary(object, ...)
-
-

Arguments

+
+

Arguments

object
@@ -66,28 +51,24 @@

Arguments

additional function arguments

-
-

Value

+
+

Value

summary.pte_results object

-
- -
+
-
- +
diff --git a/docs/reference/summary.pte_results.html b/docs/reference/summary.pte_results.html index 887d375..491f54c 100644 --- a/docs/reference/summary.pte_results.html +++ b/docs/reference/summary.pte_results.html @@ -1,61 +1,46 @@ -summary.pte_results — summary.pte_results • ptetools - - -
-
-
- +
+
+
-
+

A function to summarize pte results.

-
+
+

Usage

# S3 method for class 'pte_results'
 summary(object, ...)
-
-

Arguments

+
+

Arguments

object
@@ -67,23 +52,19 @@

Arguments

-
- -
+
-
- +
diff --git a/docs/reference/two_by_two_subset.html b/docs/reference/two_by_two_subset.html index 9ba2021..6465eb3 100644 --- a/docs/reference/two_by_two_subset.html +++ b/docs/reference/two_by_two_subset.html @@ -1,61 +1,49 @@ -two_by_two_subset — two_by_two_subset • ptetoolstwo_by_two_subset — two_by_two_subset • ptetools - - -
-
-
- +
+
+
-
+

A function for computing a 2x2 subset of original data. This is the subset with post treatment periods separately for the treated group and comparison group and pre-treatment periods in the period immediately before the treated group became treated.

-
+
+

Usage

two_by_two_subset(
   data,
   g,
@@ -67,8 +55,8 @@ 

two_by_two_subset

)
-
-

Arguments

+
+

Arguments

data
@@ -110,31 +98,27 @@

Arguments

extra arguments to get the subset correct

-
-

Value

+
+

Value

list that contains correct subset of data, n1 number of observations in this subset, and disidx a vector of the correct ids for this subset.

-
- -
+
-
- +
diff --git a/docs/reference/wif.html b/docs/reference/wif.html index 90db938..86f1f98 100644 --- a/docs/reference/wif.html +++ b/docs/reference/wif.html @@ -1,64 +1,51 @@ -Compute extra term in influence function due to estimating weights — wif • ptetoolsCompute extra term in influence function due to estimating weights — wif • ptetools - - -
-
-
- +
+
+
-
+

A function to compute the extra term that shows up in the influence function for aggregated treatment effect parameters due to estimating the weights

-
+
+

Usage

wif(keepers, pg, weights.ind, G, group)
-
-

Arguments

+
+

Arguments

keepers
@@ -83,28 +70,24 @@

Arguments

vector of groups

-
-

Value

+
+

Value

nxk influence function matrix

-
- -
+
-
- +
diff --git a/docs/sitemap.xml b/docs/sitemap.xml index e8f4cc4..f36d73e 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -1,54 +1,54 @@ -/404.html -/authors.html -/index.html -/reference/aggte_obj.html -/reference/attgt_if.html -/reference/attgt_noif.html -/reference/attgt_pte_aggregations.html -/reference/compute.pte.html -/reference/compute.pte2.html -/reference/crit_val_checks.html -/reference/did_attgt.html -/reference/dose_obj.html -/reference/getSE.html -/reference/get_agg_inf_func.html -/reference/ggpte.html -/reference/ggpte_cont.html -/reference/group_time_att.html -/reference/gt_data_frame.html -/reference/index.html -/reference/keep_all_pretreatment_subset.html -/reference/keep_all_untreated_subset.html -/reference/mboot2.html -/reference/orig2t.html -/reference/overall_weights.html -/reference/panel_empirical_bootstrap.html -/reference/print.group_time_att.html -/reference/print.pte_results.html -/reference/print.summary.dose_obj.html -/reference/print.summary.pte_results.html -/reference/process_att_gt.html -/reference/pte.html -/reference/pte2.html -/reference/pte_aggte.html -/reference/pte_attgt.html -/reference/pte_default.html -/reference/pte_dose_results.html -/reference/pte_emp_boot.html -/reference/pte_params.html -/reference/pte_results.html -/reference/qott_pte_aggregations.html -/reference/qtt_pte_aggregations.html -/reference/setup_pte.html -/reference/setup_pte_basic.html -/reference/summary.aggte_obj.html -/reference/summary.dose_obj.html -/reference/summary.group_time_att.html -/reference/summary.pte_emp_boot.html -/reference/summary.pte_results.html -/reference/t2orig.html -/reference/two_by_two_subset.html -/reference/wif.html +https://github.com/bcallaway11/ptetools/404.html +https://github.com/bcallaway11/ptetools/authors.html +https://github.com/bcallaway11/ptetools/index.html +https://github.com/bcallaway11/ptetools/reference/aggte_obj.html +https://github.com/bcallaway11/ptetools/reference/attgt_if.html +https://github.com/bcallaway11/ptetools/reference/attgt_noif.html +https://github.com/bcallaway11/ptetools/reference/attgt_pte_aggregations.html +https://github.com/bcallaway11/ptetools/reference/compute.pte.html +https://github.com/bcallaway11/ptetools/reference/compute.pte2.html +https://github.com/bcallaway11/ptetools/reference/crit_val_checks.html +https://github.com/bcallaway11/ptetools/reference/did_attgt.html +https://github.com/bcallaway11/ptetools/reference/dose_obj.html +https://github.com/bcallaway11/ptetools/reference/getSE.html +https://github.com/bcallaway11/ptetools/reference/get_agg_inf_func.html +https://github.com/bcallaway11/ptetools/reference/ggpte.html +https://github.com/bcallaway11/ptetools/reference/ggpte_cont.html +https://github.com/bcallaway11/ptetools/reference/group_time_att.html +https://github.com/bcallaway11/ptetools/reference/gt_data_frame.html +https://github.com/bcallaway11/ptetools/reference/index.html +https://github.com/bcallaway11/ptetools/reference/keep_all_pretreatment_subset.html +https://github.com/bcallaway11/ptetools/reference/keep_all_untreated_subset.html +https://github.com/bcallaway11/ptetools/reference/mboot2.html +https://github.com/bcallaway11/ptetools/reference/orig2t.html +https://github.com/bcallaway11/ptetools/reference/overall_weights.html +https://github.com/bcallaway11/ptetools/reference/panel_empirical_bootstrap.html +https://github.com/bcallaway11/ptetools/reference/print.group_time_att.html +https://github.com/bcallaway11/ptetools/reference/print.pte_results.html +https://github.com/bcallaway11/ptetools/reference/print.summary.dose_obj.html +https://github.com/bcallaway11/ptetools/reference/print.summary.pte_results.html +https://github.com/bcallaway11/ptetools/reference/process_att_gt.html +https://github.com/bcallaway11/ptetools/reference/pte.html +https://github.com/bcallaway11/ptetools/reference/pte2.html +https://github.com/bcallaway11/ptetools/reference/pte_aggte.html +https://github.com/bcallaway11/ptetools/reference/pte_attgt.html +https://github.com/bcallaway11/ptetools/reference/pte_default.html +https://github.com/bcallaway11/ptetools/reference/pte_dose_results.html +https://github.com/bcallaway11/ptetools/reference/pte_emp_boot.html +https://github.com/bcallaway11/ptetools/reference/pte_params.html +https://github.com/bcallaway11/ptetools/reference/pte_results.html +https://github.com/bcallaway11/ptetools/reference/qott_pte_aggregations.html +https://github.com/bcallaway11/ptetools/reference/qtt_pte_aggregations.html +https://github.com/bcallaway11/ptetools/reference/setup_pte.html +https://github.com/bcallaway11/ptetools/reference/setup_pte_basic.html +https://github.com/bcallaway11/ptetools/reference/summary.aggte_obj.html +https://github.com/bcallaway11/ptetools/reference/summary.dose_obj.html +https://github.com/bcallaway11/ptetools/reference/summary.group_time_att.html +https://github.com/bcallaway11/ptetools/reference/summary.pte_emp_boot.html +https://github.com/bcallaway11/ptetools/reference/summary.pte_results.html +https://github.com/bcallaway11/ptetools/reference/t2orig.html +https://github.com/bcallaway11/ptetools/reference/two_by_two_subset.html +https://github.com/bcallaway11/ptetools/reference/wif.html diff --git a/inst/CITATION b/inst/CITATION index 6be1611..2a3355c 100644 --- a/inst/CITATION +++ b/inst/CITATION @@ -1,11 +1,21 @@ -bibentry( - bibtype = "Article", - title = , - author = , - journal = , - year = , - volume = , - number = , - pages = , - doi = -) +citHeader("To cite this package, use:") + + + bibentry( + + bibtype = "Manual", + + title = "Panel Treatment Effects Tools", + + author = + person(given = "Brantly", + family = "Callaway", + role = c("aut", "cre"), + email = "brantly.callaway@uga.edu"), + + year = "2025", + + note = "R package version 1.0.0", + + url = "https://github.com/bcallaway11/ptetools" + ) diff --git a/man/figures/README-unnamed-chunk-3-1.png b/man/figures/README-unnamed-chunk-3-1.png index b03ab79..e444852 100644 Binary files a/man/figures/README-unnamed-chunk-3-1.png and b/man/figures/README-unnamed-chunk-3-1.png differ diff --git a/man/figures/README-unnamed-chunk-6-1.png b/man/figures/README-unnamed-chunk-6-1.png index 64ad405..179287c 100644 Binary files a/man/figures/README-unnamed-chunk-6-1.png and b/man/figures/README-unnamed-chunk-6-1.png differ diff --git a/man/figures/README-unnamed-chunk-8-1.png b/man/figures/README-unnamed-chunk-8-1.png index c241cb0..1c76508 100644 Binary files a/man/figures/README-unnamed-chunk-8-1.png and b/man/figures/README-unnamed-chunk-8-1.png differ diff --git a/man/pte.Rd b/man/pte.Rd index 7fb2f2a..916af8c 100644 --- a/man/pte.Rd +++ b/man/pte.Rd @@ -148,7 +148,8 @@ Main function for computing panel treatment effects \seealso{ Useful links: \itemize{ - \item \url{https://github.com/bcallaway11/pte} + \item \url{https://github.com/bcallaway11/ptetools} + \item Report bugs at \url{https://github.com/bcallaway11/ptetools/issues} } }