https://github.com/bcallaway11/ife

Treatment Effects in Interactive Fixed Effects Model

https://github.com/bcallaway11/ife

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.1%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

Treatment Effects in Interactive Fixed Effects Model

Basic Info
  • Host: GitHub
  • Owner: bcallaway11
  • Language: R
  • Default Branch: master
  • Size: 899 KB
Statistics
  • Stars: 17
  • Watchers: 1
  • Forks: 3
  • Open Issues: 2
  • Releases: 0
Created almost 5 years ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog

README.Rmd

---
output: github_document
---




```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```





```{r, echo=FALSE, results="hide", warning=FALSE, message=FALSE}
#library(pte)
devtools::load_all("~/Dropbox/pte")
devtools::load_all("~/Dropbox/ife")
load("~/Dropbox/ife/data/job_displacement_data.rda")
library(ggplot2)
library(dplyr)
```

# Interactive Fixed Effects (ife) Package 


The `ife` package contains code to estimate treatment effects in a setup where a researcher has access to panel data (or, hopefully in the near future, repeated cross sections data) and where untreated potential outcomes are generated by an interactive fixed effects model.  

The package is not currently available on CRAN, but the development version of the package can be installed from github by
```{r eval=FALSE}
# install.packages("devtools")
devtools::install_github("bcallaway11/ife")
```

## Example

Next, we provide a brief example using the application from Callaway and Karami (2021).


```{r}
res <- ife(yname="earn",
           gname="first.displaced",
           tname="year",
           idname="id",
           data=job_displacement_data,
           nife=1,
           xformla=~EDUC + race + gender,
           zformla=~EDUC + race + gender + afqt,
           ret_ife_regs=TRUE,
           anticipation=1,
           cband=FALSE,
           alp=0.10,
           boot_type="multiplier",
           biters=1000,
           cl=10)

summary(res)
ggpte(res) + ylim(c(-7000,7000))
```


We also have some code for running *individual-specific linear trends models*.  These are a special case of the interactive fixed effects models that we consider in the paper, but where the factors $F_t$ are restricted to be equal to $t$.  We mostly argue *against* these sorts of models in the paper, but one advantage is that they do not require any restrictions/assumptions about finding a covariate whose effects do not change over time.

This code also implements a version of linear trends that is specific to untreated potential outcomes.  Presumably, many of the same criticisms (and perhaps more actually) in recent papers about implementing DID with a two-way fixed effects regression likely apply when one includes individual-specific linear trends in the same sort of specification.  The code we provide here circumvents those issues.

```{r}
lt_res <- linear_trends(yname="earn",
                        gname="first.displaced",
                        tname="year",
                        idname="id",
                        data=job_displacement_data,
                        xformla=~EDUC + race + gender,
                        anticipation=1,
                        cband=FALSE,
                        alp=0.10,
                        boot_type="multiplier",
                        biters=1000,
                        cl=10)

summary(lt_res)
ggpte(lt_res) + ylim(c(-7000,7000))
```

Owner

  • Login: bcallaway11
  • Kind: user
  • Location: Athens, GA
  • Company: University of Georgia

Brantly Callaway, Department of Economics, University of Georgia

GitHub Events

Total
  • Watch event: 1
  • Issue comment event: 1
  • Push event: 3
Last Year
  • Watch event: 1
  • Issue comment event: 1
  • Push event: 3

Dependencies

DESCRIPTION cran
  • R >= 2.10 depends
  • BMisc * imports
  • DRDID * imports
  • dplyr * imports
  • ivreg * imports
  • modelsummary * imports
  • pte * imports
  • sandwich * imports
  • tidyr * imports
  • testthat >= 3.0.0 suggests