How wbroscious/bargaining works
1. This repository is an analysis pipeline for Matthew Backus’s eBay bargaining data, not an application server or package. The architecture is a sequence of numbered Python scripts that transform raw bargaining records into derived variables, analysis samples, regressions, and publication-ready tables/figures.
2. The first subsystem is data/schema setup. 01_Load_Schema.py and compare_schemas.py establish the data model and check that the loaded data match the expected schema. Supporting docs like Delay_Schema.txt, Codebook.xlsx, Documentation.docx, and memory/project_overview.md describe the underlying fields and project conventions.
3. The next layer is feature engineering and sample definition. 02_Variable_Creation.py, 09_Alternative_Variable_Creation.py, and 09b_Variable_Creation_Full.py build the main analysis variables, while 03_Sample_Justification.py and 04_Sample_Creation.py define and defend the final estimation sample. This is the main boundary between raw data and analysis-ready data.
4. Baseline inference lives in the regression layer. 05_Regressions.py, Regressions.py, 06_Other_Statistics.py, and Table_Category_Regressions.tex produce the core econometric results and summary tables. These scripts are the central consumer of the engineered sample and variables.
5. A separate branch handles causal credibility and sensitivity. 07_Robustness_Checks.py, 08_Identification_Tests.py, 25_threshold_sensitivity.py, 26_compare_naive_vs_asof.py, 33_bimodality_test.py, 34_zinb_test.py, and 34b_diag.py test whether results survive alternative specifications, matching logic, threshold choices, and distributional assumptions.
6. Several scripts focus on event structure and bargaining dynamics over time. 10_Events.py, 13_Bargaining_Test.py, 14_Bilateral_Monopoly.py, 22_accept_worse*.py, 23_worse_category_controlling_gs.py, and 32_rate_persistence_floor.py examine negotiation behavior, acceptance patterns, and dynamic outcomes after specific events.
7. Another major subsystem is seller- and competition-level analysis. 11_Competition_Regressions.py, 12_Seller_Regressions.py, 12a_Build_Seller_Reg.py, 42_long_negotiation_sellers.py, 43_seller_6227032.py, 44_seller_leaf_specialization.py, 44b_meta_specialization.py, 45_sellers_highST_lowdemand.py, and 46_target_seller_negotiations.py shift the unit of analysis from listings to sellers and seller groups.
8. The repo also contains many focused exploratory modules around market structure and bargaining frictions: 15_linked_items.py, 16_group_size_analysis.py, 17_price_gap_analysis.py, 18_relist_bid_rate.py, 19_sale_channels.py, 20_group_size_leaves.py, 21_bm_and_highgs.py, 27_chain_flag_heterogeneity.py, 28_build_listing_bidrate.py, 29_stamps_explore.py, 30_stamps_unsold_relist.py, and 31* scripts. These are domain-specific probes into relisting, group size, channel differences, and item/category specialization.
9. Output artifacts are split from code but still part of the analysis architecture. Figures/, PDF_Old/, BM_Identification_Report.pdf, Asymmetric_Aspirational_eBay_Bargaining.pdf, Aspirational_Bargaining.txt, Analysis_Summary.md, thickness_regression_by_category.xlsx, and Table_Category_Regressions.tex are generated deliverables for writing, plotting, and reporting.
10. There is a lightweight validation/debugging layer for consistency across iterations of the pipeline. compare_new_to_debug.py, compare_seller_results.py, sample_compare.py, inspect_debug.py, and diagnose_listing_count.py compare schemas, samples, and seller-level outputs to catch regressions when the analysis logic changes.
11. The overall data flow is one-way: raw bargaining data and schema definitions feed variable creation, which feed sample construction, which feed the main regressions and specialized sub-analyses, which then feed tables, figures, and reports. The numbered filenames strongly suggest a staged research workflow where later scripts depend on earlier outputs rather than a single monolithic program.
12. In architecture-diagram terms, the key boundaries are: raw data/schema input; transformed analysis dataset; core econometric engine; seller/market sub-analyses; and reporting/artifact generation. This is a research codebase centered on reproducible econometric analysis rather than a service-oriented system.
Main entry points: 04_Sample_Creation.py Final sample · compare_new_to_debug.py Validation tools · 01_Load_Schema.py Schema setup · 02_Variable_Creation.py Variables
Components 21
Schema & inputs
Raw bargaining data, schema definitions, and project conventions.
- Schema setup · Defines the expected bargaining data schema and checks loaded records against it.
01_Load_Schema.py - Schema compare · Compares inferred and expected schemas to catch structural mismatches.
compare_schemas.py - Project docs · Codebook, schema notes, and project overview used to interpret fields and conventions.
memory/project_overview.md
Prep & sampling
Feature engineering and sample construction.
- Variables · Builds the main analysis variables from raw bargaining records.
02_Variable_Creation.py - Alt variables · Alternative and full variable-construction variants for sensitivity analysis and extended coverage.
09_Alternative_Variable_Creation.py - Sample logic · Explains and justifies inclusion rules for the final estimation sample.
03_Sample_Justification.py - Final sample · Constructs the analysis sample used by the downstream regressions and tests.
04_Sample_Creation.py
Core inference
Baseline regressions and summary statistics.
- Regressions · Main regression engine for the core bargaining results.
05_Regressions.py - Summary stats · Produces additional statistics and supporting tables for the core analysis.
06_Other_Statistics.py - Regression module · Reusable regression definitions or shared logic used across the main results pipeline.
Regressions.py
Extensions
Robustness, dynamics, seller analysis, and exploratory modules.
- Robustness · Alternative specifications and checks for stability of the baseline findings.
07_Robustness_Checks.py - Identification · Tests identification assumptions and matching logic behind the causal interpretation.
08_Identification_Tests.py - Events · Analyzes event structure and bargaining dynamics over time.
10_Events.py - Seller regressions · Shifts the unit of analysis from listings to sellers and seller-level outcomes.
12_Seller_Regressions.py - Competition · Studies competition-related bargaining effects and market-level regressions.
11_Competition_Regressions.py - Bargaining tests · Checks negotiation behavior, acceptance patterns, and bilateral monopoly cases.
13_Bargaining_Test.py - Market probes · Domain-specific scans of relisting, group size, channels, persistence, and other frictions.
15_linked_items.py - Sensitivity suite · Threshold, matching, distributional, and specification sensitivity checks.
25_threshold_sensitivity.py - Seller focus · Targeted seller-level investigations and specialization analyses.
42_long_negotiation_sellers.py
Reports & validation
Published deliverables and consistency checks.
- Validation tools · Compares schemas, samples, and seller outputs across iterations to catch regressions.
compare_new_to_debug.py - Reports · Generated figures, tables, and paper/report outputs for publication and review.
Analysis_Summary.md
Connections 24
- Project docs → Schema setup: define fields · Documentation specifies the expected schema and project conventions.
- Schema setup → Schema compare: verify · Loaded records are checked against the expected schema.
- Schema setup → Variables: feed raw data · Schema-loaded bargaining records enter feature engineering.
- Variables → Sample logic: define sample · Engineered variables support sample inclusion logic.
- Sample logic → Final sample: construct · Sample rules are implemented to create the final analysis sample.
- Variables → Final sample: inputs · Sample construction depends on derived variables and flags.
- Final sample → Regressions: estimate · The final sample feeds the baseline regressions.
- Final sample → Summary stats: summarize · Sample data also feeds descriptive statistics.
- Alt variables → Robustness: alt specs · Alternative variable definitions support sensitivity checks.
- Final sample → Robustness: test stability · Robustness checks re-run the core analysis under alternative assumptions.
- Final sample → Identification: test design · Identification tests probe the assumptions behind the sample and matching logic.
- Final sample → Events: analyze dynamics · Event-based analysis uses the constructed sample to study bargaining sequences.
- Final sample → Competition: market effects · Competition analysis reuses the analysis sample at a broader market level.
- Final sample → Seller regressions: seller unit · Seller regressions aggregate or restructure the sample at the seller level.
- Final sample → Bargaining tests: behavioral analysis · Negotiation tests examine acceptance and bargaining behavior in the sample.
- Final sample → Market probes: probe frictions · Exploratory modules study relisting, group size, channels, and persistence effects.
- Final sample → Sensitivity suite: sensitivity · Threshold and specification sensitivity modules depend on the analysis sample.
- Final sample → Seller focus: case studies · Targeted seller analyses isolate particular sellers or seller cohorts.
- Regressions → Reports: publish results · Main regressions generate tables and figures for the final outputs.
- Summary stats → Reports: publish stats · Summary statistics flow into tables and report artifacts.
- Robustness → Reports: report checks · Robustness outputs are packaged into the reporting layer.
- Validation tools → Schema compare: cross-check · Validation scripts compare schemas, samples, and outputs across runs.
- Validation tools → Final sample: sample audit · Sample comparison tooling helps detect regressions in construction logic.
- Validation tools → Seller regressions: seller audit · Seller comparison tooling checks consistency of seller-level outputs.