Skip to content

Repository files navigation

Replication Code for "Breaking in or Breaking Through? How Local Specialisations Shape the Integration of AI Technologies"

This repository contains the full R implementation for the analysis presented in the paper: "Breaking in or Breaking Through? How Local Specialisations Shape the Integration of AI Technologies". The published paper can be accessed here.

The code and supporting files can be used to reproduce all calculations, figures, and robustness analyses presented in the paper. For a user-friendly overview of the code and the main estimations, please see the supplementary html summary file (also available as index.html in this repository).

Documentation Map

The remainder of this README is structured to guide you from high-level concepts to technical implementation:

*   🎥 Video & Visual Abstract: A multimedia summary of the paper's core findings (Video + Infographic).
*   🗂️ Repository & Documentation Overview
*   ⚡ Quick Start: Step-by-step instructions on how to reproduce the analysis using the R scripts.
*   💾 Data Requirements: Details on the proprietary (PATSTAT) and open-source data needed.
*   📊 Generated Files: A dictionary of the key output files you will create.

🎥 Video Overview & Visual Abstract

To make the findings accessible to a broader audience (as well as give a quick overview of the paper), we have created a visual map of the core mechanisms and an AI-generated animated video synthesis.

🎥🎧 Video: The Strategic Path to AI Leadership

An AI-generated discussion (via NotebookLM) synthesizing the paper's contextualization and main findings.

Watch the Video Summary

🗺️ Visualize: The Mechanics of AI Integration

The image below illustrates the two distinct pathways for national AI integration identified in the paper: anchoring AI to historical industrial strengths vs. developing frontier specialization.

infographic

🗂️ Repository & Documentation Overview

File Structure

The repository is organized as follows:

/
├── large_files/                            # (User-provided) Raw PATSTAT data (ignored by git)
├── other_files/                            # Supporting input files and sample data
├── Files_created_with_the_code/            # Output directory for all generated results
│   ├── data/                               # Processed datasets (intermediate & final)
│   └── figures/                            # All plots generated by the R scripts
├── 1.Main_code.R                           # Script 1: Generates primary results & main figures
├── 2.Figures_appendix.R                    # Script 2: Reproduces appendix figures
├── 3.Robustness_analysis.R                 # Script 3: Runs additional robustness checks
├── index.Rmd                               # Source for the detailed HTML walkthrough
├── infographic.png                         # Visual abstract for the README
└── README.md                               # This documentation file
/

Quick Start & How to Run

  1. Step-by-step Guide: For a detailed, step-by-step walkthrough of the main analysis, please see the R Markdown file index.Rmd or the compiled html. This file explains the entire analytical pipeline, from data preparation to the generation of the main figures and econometric analyses. It also contains the additional regressions performed for Table 3 and Table 4, which are briefly mentioned in the footnotes of the paper.

  2. Running the Scripts: The analysis is divided into three main R scripts that should be run in order:

    • 1.Main_code.R: Generates the primary results and main figures of the paper.
    • 2.Figures_appendix.R: Reproduces the figures presented in the appendices.
    • 3.Robustness_analysis.R: Conducts the additional robustness checks, such as varying time intervals and RTA thresholds.

Data Requirements

Running the code in this repository requires two sets of input data, organized into the large_files and other_files folders.

⚠️ Required Proprietary Data (large_files)

The large_files folder is designed to contain the complete patent and inventor location data from the PATSTAT 2019 (spring edition) database for the period 1974–2018.

Important: Due to PATSTAT's intellectual property restrictions and large file sizes, this raw data is not provided in this repository (the folder is ignored by .gitignore).

For users without a PATSTAT license: A similar, publicly available dataset that links patents to inventor locations can be accessed here: https://doi.org/10.7910/DVN/OTTBDX.

For users with a PATSTAT license wishing to perform a full replication: You will need to generate the input files following the geolocational strategy presented in De Rassenfosse et al. (2019) and structure them as follows:

  • The data should be split into two categories for the two levels of analysis: technological fields and IPC subclasses.
  • Due to their size, each category must be further divided into two parts:
    • Part1: containing data from 1974 to 2003 (inclusive).
    • Part2: containing data from 2004 to 2018 (inclusive).

✅ Provided Supporting Files (other_files)

The other_files folder is included in this repository and contains all other necessary input files. Crucially, this folder also includes small data samples (e.g., All_patents_and_IPCs_Part1_SmallSampleWithHeader.csv) to illustrate the exact format, column names, and structure required for the proprietary data.


Repository Structure

  • large_files/ (User-provided): Destination for large, proprietary PATSTAT data files. This folder is listed in .gitignore. An overview of these files inside their respective folder is shown below:

image

  • other_files/ (Included): Contains all necessary supporting data and samples of the proprietary files to show the required format.
  • Files_created_with_the_code/ (Generated): This is the output directory where all generated data and figures are saved. It is organized into two subfolders:
    • data/: Contains all processed datasets and analytical results. It is further subdivided into files_code_Fields_analysis/ and files_code_4-digits_analysis/.
    • figures/: Contains all figures generated by the R scripts.

Note on .gitignore: In addition to large_files/, a subfolder for the permutation data (Files_created_with_the_code/data/files_code_4-digits_analysis/robustness/) is also ignored due to its large size (>1GB). The code will generate these files if run.


Description of Key Generated Data Files

The R scripts will generate a number of intermediate and final data files. The most important outputs saved in Files_created_with_the_code/data/ include:

Technological Fields Analysis (files_code_Fields_analysis/)

  • reg_tech_*.csv & reg_techAI_*.csv: These files contain the foundational patent counts per country, per technological field, for each of the three main time intervals, for both 'general' (all patents) and 'AI-specific' patents.
  • Data*period_RTA_techn_field.csv: Contains the calculated RTA values for all countries and technological fields for each of the three main intervals.
  • RTA_4countries_detailed.csv: A summary file containing the detailed RTA values and specialization types ('general', 'AI-specific', 'coinciding') for the four leading countries across all periods.

IPC Subclass Analysis (files_code_4-digits_analysis/)

  • Data*period_RTA_subclass.csv: The equivalent of the RTA files above, but at the more granular IPC subclass level.
  • RTA_*_AI.csv: Contains the RTA values for subclasses calculated using only AI patents for each of the three intervals.
  • IPC_RTAs_subclass.csv: A summary file combining the general and AI-specific subclass specializations for all intervals.

Many other files are generated, particularly for the robustness analyses, which typically recalculate these core datasets under different time intervals or RTA thresholds.

About

This repository contains the full R implementation for the analysis presented in the paper: "Breaking in or Breaking Through? How Local Specialisations Shape the Integration of AI Technologies".

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages