Replication Package — Overview and Instructions
==================================================

1. Package structure
--------------------
The replication package is organized into three main components:

/
├─ Laboratory Package/
├─ Data/
└─ Do files/
   ├─ Figures/
   └─ Tables/

These components are linked as follows:

- Laboratory Package documents how the experiment was implemented in the lab
  (z-Tree programs, instructions, images).
- Data contains (i) the original raw data received from the lab and (ii) the
  scripts that transform it into the analysis-ready dataset used in the paper.
- Do files contains the replication scripts that use the analysis-ready dataset
  to reproduce the paper’s figures and tables.


2. Laboratory Package
---------------------
Purpose: archival documentation of the experimental implementation.

Typical contents include:
- Images/ — visual materials shown to participants
- Instructions/ (and/or Word/PDF files) — experimenter and participant instructions
- z-Tree source files (.ztt, .ztq, etc.) — experimental programs and questionnaires

This folder is not required to run the statistical replication, but it provides
transparency and supports verification of the experimental design and procedures.


3. Data
-------
Purpose: produce the analysis-ready dataset from the raw lab exports.

Typical contents include:
- original data/ — raw files as received from the lab (inputs)
- Building dataset.do — Stata script that cleans/merges/transforms the raw data
- Workable_dataset.dta — analysis-ready dataset used by all replication scripts (output)
- Variable lists - Dictionary.pdf — variable descriptions and codebook

Rebuilding the analysis dataset (optional)
If Workable_dataset.dta is already provided, the replication can be run directly.
To rebuild it from raw data:

1) Open Stata
2) Set the working directory to the Data/ folder
3) Run:
   do "Building dataset.do"

This should recreate Workable_dataset.dta (and any other intermediate outputs
produced by the data-building script).


4. Do files
-----------
Purpose: reproduce the paper outputs (figures and tables) from Workable_dataset.dta.

Do files/
├─ Figures/
│  ├─ 00_setup.do
│  ├─ master.do
│  ├─ do_Fig2_portable.do
│  ├─ do_Fig3_portable.do
│  ├─ do_Fig4_portable.do
│  └─ output/
│     └─ figures/
└─ Tables/
   ├─ 00_setup.do
   ├─ master.do
   ├─ do_Table_4_portable.do
   ├─ ...
   └─ output/
      └─ tables/

How the replication scripts work
- 00_setup.do defines portable folder paths (based on the current working
  directory) and creates output folders if needed.
- master.do is the single entry point that calls all figure/table scripts in
  the correct order.
- Each do_Fig*_portable.do or do_Table_*_portable.do:
  - loads Workable_dataset.dta
  - performs the required transformations/estimations
  - exports the output files to the corresponding output folder


5. Running the replication
--------------------------

Prerequisites
- Stata (the exact minimum version depends on the commands used in the do-files).
- If regression tables are exported to LaTeX using esttab/estout, install if needed:
    ssc install estout, replace

A. Reproduce Figures
1) Open Stata
2) Set the working directory to the Figures folder:
     cd "Do files/Figures"
3) Run:
     do "master.do"

Outputs are written to:
  Do files/Figures/output/figures/
(and a log file, if enabled by the scripts).

B. Reproduce Tables
1) Open Stata
2) Set the working directory to the Tables folder:
     cd "Do files/Tables"
3) Run:
     do "master.do"

Outputs are written to:
  Do files/Tables/output/tables/
(and a log file, if enabled by the scripts).


6. Notes on paths and portability
---------------------------------
- The replication do-files are designed to work with relative paths.
- The only strict requirement is to cd into the relevant folder (Figures or
  Tables) before running master.do.
- If folder names differ by capitalization (e.g., Data vs data), ensure the
  dataset is placed in the location expected by the setup script (as defined in
  00_setup.do).


7. Troubleshooting
------------------
- Dataset not found: confirm Workable_dataset.dta exists and the path in
  00_setup.do points to the correct Data/ location.
- Missing user-written packages: install the package named in the error message
  (common example: estout).
- Empty output folder: check the Stata log (if produced) or run individual
  do-files to identify where execution stops.
