Replication package for: Do tips scale with prices? Evidence from a regulated taxi fare increase
Description
Data and code that reproduce every number, table and figure in the article "Do tips scale with prices? Evidence from a regulated taxi fare increase" by Kaibo Tang and in its Online Appendix. The article uses the fare increase for New York City yellow taxis on 19 December 2022 to estimate how card tips respond to the price, in a difference-in-discontinuities design that compares the change in tips at 19 December 2022 with the change at the same date in seasons without a fare change. Contents. replication_package.zip contains README.md (requirements, run times, the source of each table and figure); code/ (Python scripts for data processing, estimation and tables, an R script for the figures, and run_all.sh, which runs them in order); data/derived/ (daily aggregates, cell tables, tip-rate histograms and a deterministic 10% and 2% sample of card-paid trips, in Parquet format, built from the raw trip records); data/raw/tlc/ (SHA-256 checksums of the 21 raw monthly files and the TLC taxi zone lookup); and output/ (results.json with every reported number, bootstrap draws, table and figure data as CSV, figures as PDF). How to run. Unzip, change to code/ and run ./run_all.sh (about 4 minutes). It needs Python 3.11 or later (packages in code/requirements.txt) and, for the figures, R 4.4 with ggplot2 (packages in README.md). FROM_RAW=1 ./run_all.sh first downloads the raw files (about 1.9 GB), checks their checksums and rebuilds data/derived/ (about 8 minutes plus the download). Data source and terms. New York City Taxi and Limousine Commission (TLC) Trip Record Data: yellow-taxi trip records for November to January of 2016–17 to 2019–20 and 2021–22 to 2023–24 (documentation: https://www.nyc.gov/site/tlc/about/tlc-trip-record-data.page; files: https://d37ci6vzurychx.cloudfront.net/trip-data/, last accessed 1 November 2026; SHA-256 checksums in data/raw/tlc/SHA256SUMS.txt). The records were collected by the taxis' technology service providers and are published by the TLC, which does not guarantee their accuracy. They are public data of the City of New York, available without registration, license requirement or restrictions on use (NYC Administrative Code, section 23-502), under the NYC.gov and NYC Open Data terms of use. Modifications: the trips were filtered, repriced under both tariffs, classified by tip choice, aggregated by day and sampled, as documented in the code and the Online Appendix. The records are de-identified (no driver, vehicle or passenger identifiers); tips are recorded only for card payments. The CC BY 4.0 license of this dataset covers the code, the derived data and the results; the TLC taxi zone lookup (included unchanged) and the trip records behind the derived data remain under the City's terms. Keywords: tipping; social norm; magnitude effect; default option; natural experiment; price pass-through; New York City taxi; difference-in-discontinuities.
Files
Steps to reproduce
1. Download replication_package.zip and unzip it (63 MB). The raw-data path below needs about 3 GB of free disk space. 2. Install Python 3.11 or later and the packages in code/requirements.txt: pip install -r code/requirements.txt (duckdb 2.0.0, pyarrow 26.0.0, pandas 3.0.6, numpy 2.5.4, scipy 1.18.1, statsmodels 0.15.0, pyfixest 0.60.0). 3. For the figures, install R (developed with R 4.4.3) and the CRAN packages ggplot2, patchwork, data.table, scales, ragg and svglite. 4. From code/, run ./run_all.sh. It runs the analysis on the derived data in data/derived/ and rewrites output/results.json, the tables in output/tables/ and Figures 1–3 in output/figures/ (about 4 minutes; 260 s in a clean test on a Linux machine with 8 cores and 15 GB RAM). Other interpreters: PYTHON=/path/to/python RSCRIPT=/path/to/Rscript ./run_all.sh. 5. To start from the raw data, run FROM_RAW=1 ./run_all.sh. It downloads the 21 monthly TLC files (about 1.9 GB), compares their SHA-256 checksums with data/raw/tlc/SHA256SUMS.txt (a mismatch is reported, for example if the TLC has republished a file), rebuilds data/derived/ and then runs the analysis (about 8 minutes plus the download). 6. Section 4 of README.md lists the script and the output file behind each table and figure. The bootstrap uses the seed in code/config.py. In a clean test, 3,529 of the 3,548 numbers in output/results.json were reproduced exactly; the other 19 (trip-level fixed-effects checks) differed by at most 5.6 × 10^-6 in relative terms, and no number reported in the article or the Online Appendix changed.
Institutions
- The University of OsakaOsaka, Osaka