{
  "_id": "6a4a00815cca5d75a1614caf",
  "Package": "did2s",
  "Title": "Two-Stage Difference-in-Differences Following Gardner (2021)",
  "Version": "1.2.1",
  "Authors@R": "c(person(given = \"Kyle\",\nfamily = \"Butts\",\nrole = c(\"aut\",\"cre\"),\nemail = \"buttskyle96@gmail.com\",\ncomment = c(ORCID = \"0000-0002-9048-8059\")),\nperson(given = \"John\",\nfamily = \"Gardner\",\nrole = \"aut\",\nemail = \"jrgardne@olemiss.edu\",\ncomment = c(ORCID = \"0000-0002-4028-6862\")),\nperson(given = \"Grant\",\nfamily = \"McDermott\",\nrole = \"ctb\",\nemail = \"grantmcd@uoregon.edu\",\ncomment = c(ORCID = \"0000-0001-7883-8573\")),\nperson(given = \"Laurent\",\nfamily = \"Berge\",\nrole = \"ctb\",\nemail = \"laurent.berge@u-bordeaux.fr\"))",
  "Description": "Estimates Two-way Fixed Effects\ndifference-in-differences/event-study models using the approach\nproposed by Gardner (2021) <doi:10.48550/arXiv.2207.05943>. To\navoid the problems caused by OLS estimation of the Two-way\nFixed Effects model, this function first estimates the fixed\neffects and covariates using untreated observations and then in\na second stage, estimates the treatment effects.",
  "License": "MIT + file LICENSE",
  "Encoding": "UTF-8",
  "LazyData": "true",
  "Roxygen": "list(markdown = TRUE)",
  "RoxygenNote": "7.3.2",
  "URL": "https://kylebutts.github.io/did2s/",
  "VignetteBuilder": "knitr",
  "Config/testthat/edition": "3",
  "Config/pak/sysreqs": "cmake libglpk-dev libgmp3-dev make libicu-dev\npkg-config libclang-dev",
  "Repository": "https://kylebutts.r-universe.dev",
  "Date/Publication": "2026-06-12 21:36:39 UTC",
  "RemoteUrl": "https://github.com/kylebutts/did2s",
  "RemoteRef": "HEAD",
  "RemoteSha": "cde84687aecfc11b949fbd5bd56fea1992fb76a0",
  "NeedsCompilation": "no",
  "Packaged": {
    "Date": "2026-06-12 22:26:16 UTC",
    "User": "root"
  },
  "Author": "Kyle Butts [aut, cre] (ORCID: <https://orcid.org/0000-0002-9048-8059>),\nJohn Gardner [aut] (ORCID: <https://orcid.org/0000-0002-4028-6862>),\nGrant McDermott [ctb] (ORCID: <https://orcid.org/0000-0001-7883-8573>),\nLaurent Berge [ctb]",
  "Maintainer": "Kyle Butts <buttskyle96@gmail.com>",
  "_user": "kylebutts",
  "_type": "src",
  "_file": "did2s_1.2.1.tar.gz",
  "_fileid": "https://r2.ropensci.org/d8cab0130ff5265f0c89000e3a66e824fd6b23bb53b310763bd9c4b52c912097",
  "_filesize": 3806850,
  "_sha256": "d8cab0130ff5265f0c89000e3a66e824fd6b23bb53b310763bd9c4b52c912097",
  "_expires": "2026-10-13T06:58:07.000Z",
  "_created": "2026-06-12T22:26:16.000Z",
  "_published": "2026-07-05T06:58:09.076Z",
  "_jobs": [
    {
      "job": 85201057047,
      "time": 242,
      "config": "linux-devel-x86_64",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "7603977915"
    },
    {
      "job": 85201057201,
      "time": 216,
      "config": "linux-release-x86_64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7603970287"
    },
    {
      "job": 85201057245,
      "time": 138,
      "config": "macos-oldrel-arm64",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "7603951438"
    },
    {
      "job": 85201057063,
      "time": 109,
      "config": "macos-release-arm64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7603945922"
    },
    {
      "job": 85201057025,
      "time": 338,
      "config": "source",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7603917430"
    },
    {
      "job": 85201057192,
      "time": 172,
      "config": "wasm-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7603961144"
    },
    {
      "job": 85201057213,
      "time": 133,
      "config": "windows-devel",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "7603951420"
    },
    {
      "job": 85201057182,
      "time": 121,
      "config": "windows-oldrel",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "7603947581"
    },
    {
      "job": 85201057085,
      "time": 135,
      "config": "windows-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7603951141"
    }
  ],
  "_host": "GitHub-Actions",
  "_buildurl": "https://github.com/r-universe/kylebutts/actions/runs/27446386907",
  "_status": "success",
  "_upstream": "https://github.com/kylebutts/did2s",
  "_commit": {
    "id": "cde84687aecfc11b949fbd5bd56fea1992fb76a0",
    "author": "Kyle Butts <buttskyle96@gmail.com>",
    "committer": "Kyle Butts <buttskyle96@gmail.com>",
    "message": "Remove -1 as ref\n",
    "time": 1781300199
  },
  "_maintainer": {
    "name": "Kyle Butts",
    "email": "buttskyle96@gmail.com",
    "login": "kylebutts",
    "twitter": "@kylefbutts",
    "description": "Assistant Professor of Economics\nUniversity of Arkansas",
    "uuid": 19961439,
    "orcid": "0000-0002-9048-8059"
  },
  "_distro": "noble",
  "_registered": true,
  "_dependencies": [
    {
      "package": "R",
      "version": ">= 3.5.0",
      "role": "Depends"
    },
    {
      "package": "fixest",
      "version": ">= 0.13.2",
      "role": "Depends"
    },
    {
      "package": "boot",
      "role": "Imports"
    },
    {
      "package": "broom",
      "role": "Imports"
    },
    {
      "package": "data.table",
      "role": "Imports"
    },
    {
      "package": "did",
      "role": "Imports"
    },
    {
      "package": "didimputation",
      "role": "Imports"
    },
    {
      "package": "dreamerr",
      "role": "Imports"
    },
    {
      "package": "ggplot2",
      "role": "Imports"
    },
    {
      "package": "HonestDiD",
      "role": "Imports"
    },
    {
      "package": "Matrix",
      "role": "Imports"
    },
    {
      "package": "rlang",
      "role": "Imports"
    },
    {
      "package": "staggered",
      "role": "Imports"
    },
    {
      "package": "stats",
      "role": "Imports"
    },
    {
      "package": "haven",
      "role": "Suggests"
    },
    {
      "package": "knitr",
      "role": "Suggests"
    },
    {
      "package": "rmarkdown",
      "role": "Suggests"
    },
    {
      "package": "testthat",
      "version": ">= 3.0.0",
      "role": "Suggests"
    }
  ],
  "_owner": "kylebutts",
  "_selfowned": true,
  "_usedby": 0,
  "_updates": [
    {
      "week": "2025-35",
      "n": 2
    },
    {
      "week": "2025-38",
      "n": 3
    },
    {
      "week": "2025-50",
      "n": 1
    },
    {
      "week": "2026-11",
      "n": 1
    },
    {
      "week": "2026-24",
      "n": 1
    }
  ],
  "_tags": [],
  "_stars": 111,
  "_contributors": [
    {
      "user": "kylebutts",
      "count": 128,
      "uuid": 19961439
    },
    {
      "user": "grantmcdermott",
      "count": 7,
      "uuid": 10285037
    },
    {
      "user": "sebkrantz",
      "count": 3,
      "uuid": 48053842
    },
    {
      "user": "ph-add",
      "count": 2,
      "uuid": 122570531
    },
    {
      "user": "vnery5",
      "count": 2,
      "uuid": 63151005
    },
    {
      "user": "etiennebacher",
      "count": 1,
      "uuid": 52219252
    }
  ],
  "_userbio": {
    "uuid": 19961439,
    "type": "user",
    "name": "Kyle F Butts",
    "description": "Assistant Professor of Economics\r\nUniversity of Arkansas"
  },
  "_downloads": {
    "count": 1983,
    "source": "https://cranlogs.r-pkg.org/downloads/total/last-month/did2s"
  },
  "_devurl": "https://github.com/kylebutts/did2s",
  "_pkgdown": "https://kylebutts.github.io/did2s/",
  "_searchresults": 331,
  "_rbuild": "4.6.0",
  "_assets": [
    "extra/citation.cff",
    "extra/citation.html",
    "extra/citation.json",
    "extra/citation.txt",
    "extra/contents.json",
    "extra/did2s.html",
    "extra/NEWS.html",
    "extra/NEWS.txt",
    "extra/readme.html",
    "extra/readme.md",
    "LICENSE",
    "manual.pdf"
  ],
  "_homeurl": "https://github.com/kylebutts/did2s",
  "_realowner": "kylebutts",
  "_cranurl": true,
  "_releases": [
    {
      "version": "0.4.0",
      "date": "2021-09-27"
    },
    {
      "version": "0.6.0",
      "date": "2022-04-07"
    },
    {
      "version": "0.7.0",
      "date": "2022-07-21"
    },
    {
      "version": "1.0.0",
      "date": "2023-03-11"
    },
    {
      "version": "1.0.1",
      "date": "2023-03-28"
    },
    {
      "version": "1.0.2",
      "date": "2023-04-07"
    },
    {
      "version": "1.2.0",
      "date": "2025-09-19"
    },
    {
      "version": "1.2.1",
      "date": "2026-03-05"
    }
  ],
  "_exports": [
    "did2s",
    "event_study",
    "gen_data",
    "get_honestdid_obj_did2s",
    "honest_did_did2s",
    "plot_event_study"
  ],
  "_datasets": [
    {
      "name": "castle",
      "title": "Data from Cheng and Hoekstra (2013)",
      "object": "castle",
      "class": [
        "data.frame"
      ],
      "fields": [
        "year",
        "state",
        "popwt",
        "l_homicide",
        "post",
        "effyear",
        "time_til"
      ],
      "rows": 550,
      "table": true,
      "tojson": true
    },
    {
      "name": "df_het",
      "title": "Simulated data with two treatment groups and heterogenous effects",
      "object": "df_het",
      "class": [
        "data.frame"
      ],
      "fields": [
        "unit",
        "state",
        "group",
        "unit_fe",
        "g",
        "year",
        "year_fe",
        "treat",
        "rel_year",
        "rel_year_binned",
        "error",
        "te",
        "te_dynamic",
        "dep_var"
      ],
      "rows": 46500,
      "table": true,
      "tojson": true
    },
    {
      "name": "df_hom",
      "title": "Simulated data with two treatment groups and homogenous effects",
      "object": "df_hom",
      "class": [
        "data.frame"
      ],
      "fields": [
        "unit",
        "state",
        "group",
        "unit_fe",
        "g",
        "year",
        "year_fe",
        "treat",
        "rel_year",
        "rel_year_binned",
        "error",
        "te",
        "te_dynamic",
        "dep_var",
        "weight"
      ],
      "rows": 46500,
      "table": true,
      "tojson": true
    }
  ],
  "_help": [
    {
      "page": "castle",
      "title": "Data from Cheng and Hoekstra (2013)",
      "topics": [
        "castle"
      ]
    },
    {
      "page": "df_het",
      "title": "Simulated data with two treatment groups and heterogenous effects",
      "topics": [
        "df_het"
      ]
    },
    {
      "page": "df_hom",
      "title": "Simulated data with two treatment groups and homogenous effects",
      "topics": [
        "df_hom"
      ]
    },
    {
      "page": "did2s",
      "title": "Calculate two-stage difference-in-differences following Gardner (2021)",
      "topics": [
        "did2s"
      ]
    },
    {
      "page": "event_study",
      "title": "Estimate event-study coefficients using TWFE and 5 proposed improvements.",
      "topics": [
        "event_study",
        "plot_event_study"
      ]
    },
    {
      "page": "gen_data",
      "title": "Generate TWFE data",
      "topics": [
        "gen_data"
      ]
    },
    {
      "page": "get_honestdid_obj_did2s",
      "title": "get_honestdid_obj_did2s",
      "topics": [
        "get_honestdid_obj_did2s"
      ]
    },
    {
      "page": "honest_did_did2s",
      "title": "honest_did_did2s",
      "topics": [
        "honest_did_did2s"
      ]
    },
    {
      "page": "robust_solve_XtX",
      "title": "Robust solve for X'X beta = X'Y using QR decomposition",
      "topics": [
        "robust_solve_XtX"
      ]
    }
  ],
  "_readme": "https://github.com/kylebutts/did2s/raw/HEAD/README.md",
  "_rundeps": [
    "alabama",
    "backports",
    "BH",
    "bigmemory",
    "bigmemory.sri",
    "BMisc",
    "boot",
    "broom",
    "checkmate",
    "clarabel",
    "cli",
    "codetools",
    "cpp11",
    "CVXR",
    "data.table",
    "did",
    "didimputation",
    "dplyr",
    "DRDID",
    "dreamerr",
    "ECOSolveR",
    "farver",
    "fastglm",
    "fixest",
    "foreach",
    "Formula",
    "generics",
    "ggplot2",
    "glue",
    "gmp",
    "gtable",
    "highs",
    "HonestDiD",
    "isoband",
    "iterators",
    "labeling",
    "latex2exp",
    "lattice",
    "lifecycle",
    "lpSolveAPI",
    "magrittr",
    "MASS",
    "Matrix",
    "matrixStats",
    "mvtnorm",
    "nleqslv",
    "nlme",
    "numDeriv",
    "osqp",
    "pbapply",
    "pillar",
    "pkgconfig",
    "pracma",
    "purrr",
    "qrng",
    "R6",
    "RColorBrewer",
    "Rcpp",
    "RcppArmadillo",
    "RcppEigen",
    "Rglpk",
    "rlang",
    "S7",
    "sandwich",
    "scales",
    "scs",
    "slam",
    "spacefillr",
    "staggered",
    "stringi",
    "stringmagic",
    "stringr",
    "tibble",
    "tidyr",
    "tidyselect",
    "TruncatedNormal",
    "trust",
    "utf8",
    "uuid",
    "vctrs",
    "viridisLite",
    "withr",
    "zoo"
  ],
  "_vignettes": [
    {
      "source": "Two-Stage-Difference-in-Differences.Rmd",
      "filename": "Two-Stage-Difference-in-Differences.html",
      "title": "Two-Stage Difference-in-Differences",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Two-stage Difference-in-differences, Gardner (2021)",
        "Standard Errors",
        "Anticipation",
        "Covariates",
        "did2s R Package",
        "Example",
        "Estimate Two-stage Difference-in-Differences",
        "Comparison to TWFE",
        "Citation",
        "References"
      ],
      "created": "2021-06-02 05:00:53",
      "modified": "2026-06-12 21:36:39",
      "commits": 13
    }
  ],
  "_score": 8.959383699775735,
  "_indexed": true,
  "_nocasepkg": "did2s",
  "_universes": [
    "kylebutts"
  ],
  "_binaries": [
    {
      "r": "4.7.0",
      "os": "linux",
      "version": "1.2.1",
      "date": "2026-06-12T22:30:07.000Z",
      "distro": "noble",
      "commit": "cde84687aecfc11b949fbd5bd56fea1992fb76a0",
      "fileid": "https://r2.ropensci.org/59aa8a9b4bc0ec47baa7086955ed78a4e08c279aa556896e6bd738b1e3e6bfc0",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/kylebutts/actions/runs/27446386907"
    },
    {
      "r": "4.6.0",
      "os": "linux",
      "version": "1.2.1",
      "date": "2026-06-12T22:29:35.000Z",
      "distro": "noble",
      "commit": "cde84687aecfc11b949fbd5bd56fea1992fb76a0",
      "fileid": "https://r2.ropensci.org/006ffe6c9fb4d83e4dcda7fe10671eaeccd77055a6ad05b8a53de447983fa491",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/kylebutts/actions/runs/27446386907"
    },
    {
      "r": "4.5.3",
      "os": "mac",
      "version": "1.2.1",
      "date": "2026-06-12T22:28:23.000Z",
      "commit": "cde84687aecfc11b949fbd5bd56fea1992fb76a0",
      "fileid": "https://r2.ropensci.org/fef91c93c2b1dd78547038e7ec0428d64fe36f3b71fe3fc16b5657eeb7010965",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/kylebutts/actions/runs/27446386907"
    },
    {
      "r": "4.6.0",
      "os": "mac",
      "version": "1.2.1",
      "date": "2026-06-12T22:28:04.000Z",
      "commit": "cde84687aecfc11b949fbd5bd56fea1992fb76a0",
      "fileid": "https://r2.ropensci.org/8da91db69ba54da5e53b76dfbc9744af31b113f30b379d0fea87384a1aa5d793",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/kylebutts/actions/runs/27446386907"
    },
    {
      "r": "4.6.0",
      "os": "wasm",
      "version": "1.2.1",
      "date": "2026-06-12T22:29:36.000Z",
      "commit": "cde84687aecfc11b949fbd5bd56fea1992fb76a0",
      "fileid": "https://r2.ropensci.org/77e3ce1c229946bf21ded4f183bb40757c4c4d1de3170b68a87ba3661300feae",
      "status": "success",
      "buildurl": "https://github.com/r-universe/kylebutts/actions/runs/27446386907"
    },
    {
      "r": "4.7.0",
      "os": "win",
      "version": "1.2.1",
      "date": "2026-06-12T22:28:07.000Z",
      "commit": "cde84687aecfc11b949fbd5bd56fea1992fb76a0",
      "fileid": "https://r2.ropensci.org/39d0ff62f9bce36403bf78a988cde5b69079d3294c9dbde44e2ac314b4e81225",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/kylebutts/actions/runs/27446386907"
    },
    {
      "r": "4.5.3",
      "os": "win",
      "version": "1.2.1",
      "date": "2026-06-12T22:27:53.000Z",
      "commit": "cde84687aecfc11b949fbd5bd56fea1992fb76a0",
      "fileid": "https://r2.ropensci.org/a9f032107a646d20083248596fe899b1b612efc392e5f4adf23ed45bf7a8e54d",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/kylebutts/actions/runs/27446386907"
    },
    {
      "r": "4.6.0",
      "os": "win",
      "version": "1.2.1",
      "date": "2026-06-12T22:28:09.000Z",
      "commit": "cde84687aecfc11b949fbd5bd56fea1992fb76a0",
      "fileid": "https://r2.ropensci.org/8093cc9e849fd74d915d6bd8cc6897d0b6620ba27d556a17dec0fb0490e1f792",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/kylebutts/actions/runs/27446386907"
    }
  ]
}