<aside>
💡 This page provides instructions on executing the replication package to produce the final results in the paper.
</aside>
Download
Download **the replication package (20.1 GB) containing all unrestricted datasets employed in the study.
Notice that the Compustat dataset, which has restricted access, is not part of the replication package. Retrieve Compustat, rename it as “compustat_annual2.csv”, and transfer it to the "input_data" directory.
Environment setup
If you have installed both R and RStudio, begin by executing the “run_project.Rproj” file. The R project employs renv to guarantee the project's portability and reproducibility. Renv helps ensure that the environment (libraries and their versions) used in the project is consistent across different systems. If you encounter any issues while running the renv environment, try the following command:
renv::repair()
If you prefer to execute the project using the latest versions of the library rather than the ones employed by the author, deactivate the renv using “renv::deactivate()”.
Direct replication
Running the "07_tables_3_4_RUNALL.R" script alone will produce Tables 1, 3, and 4 along with Figures 1 through 5 under the folder “output”. To produce Table 5, execute the "08_table5_gmm.do".
Datasets
- input_data/202208_OECD_PATENT_QUALITY_USPTO
- input_data/compustat
- input_data/favotetal_2023
- input_data/koganetal_2017
- Kogan et al. (2017). See the source file. Compustat gvkeys linked to patent identifiers to facilitate matching PatentsView patents with the firm-level dataset.
- input_data/patentsView
- PatentsView. “PatentsView is an award-winning visualization, data dissemination, and analysis platform that focuses on intellectual property (IP) data. Support for the site and the team that works on it comes from the Office of the Chief Economist at the U.S. Patent & Trademark Office (USPTO).”
Codes
- 00_setup.R
- Sets up the environment by loading necessary libraries for data manipulation, visualization, and analysis.
- 01_build_patent_data.R
- Cleans and curates patent data
- Identifies green patents.
- Associates patent assignee information with patents for further analysis.
- 02_build_firm_data.R
- Imports and cleans Compustat data, filtering it for relevant years. It cleans industry codes and removes duplicates.
- Calculates various financial ratios and metrics based on Compustat data such as valuation, investment, profitability, and financing.
- Merges Compustat data with patent data, using Kogan et al. (2017)’s crosswalk to match patent and Compustat identifiers.