# Week 1 lab: the firm as a labor-allocation system

## Economic question and learning objectives

What changes when a firm reports higher output or lower turnover: effort, workforce composition, assignment, measurement, or workers' valuation of the job? This lab practices making the unit, population, exposure and outcome explicit before interpreting an estimate.

By the end, you should be able to:

1. distinguish a reconstruction of published statistics from re-estimation with official data;
2. compute a rate difference, percentage-point difference and proportional reduction without fabricating inference;
3. build an outcome ledger that keeps employment exit separate from missing on-job performance;
4. diagnose three artificial processes with the same raw increase using composition and incumbent comparisons;
5. specify which additional records and variation would identify a mechanism in a real organization.

The primary anchor is Bloom, Han and Liang's experiment, [Hybrid working from home improves retention without damaging performance](https://doi.org/10.1038/s41586-024-07500-2). The challenge reading is [The Value of Bosses](https://doi.org/10.1086/681097) by Lazear, Shaw and Stanton. We use the first paper to study measurement and assignment; save the wider work-arrangement policy discussion for Week 9.

## Setup

Allow approximately two hours. From the lab directory, run:

```bash
ENV_NAME=research bash smoke.sh
```

The offline run requires the repository's `research` conda environment and Matplotlib. It reconstructs published summaries and generates independent synthetic data. It does not download data. Inspect `output/reproduced/reproduction_status.json` before interpreting any output.

## Reproduce

### Bounded offline task: Mode B

Open `data/teaching/published-retention.csv`. It contains only the published rounded quitting rates: 0.072 for control and 0.048 for treatment. Running `src/reproduce-published-statistics.py` produces `output/reproduced/retention_contrast.csv` with the explicit label **published-statistic reconstruction; not microdata replication**.

| Object | Calculation from rounded rates | Result |
|---|---|---:|
| Rate difference | Treatment minus control | −0.024 |
| Percentage-point difference | 100 times the rate difference | −2.4 pp |
| Risk ratio | Treatment divided by control | 2/3 |
| Relative reduction | One minus the risk ratio | 1/3 |

These are calculations on supplied summaries, not newly estimated rates. Do not infer employee counts, standard errors, confidence intervals or p-values from this CSV. A rounding match is a successful reconstruction of this table, not a microdata replication.

Answer: why is a 2.4 percentage-point reduction different from a 2.4 percent reduction? Which denominator produces the one-third figure? What information needed for inference is absent from this teaching input?

### Separate official-release task: Mode A

The supplied preparation record also contains a completed bounded re-estimation from [official Dataverse V1.1](https://doi.org/10.7910/DVN/6X4ZZL). It uses a Python translation of inspected release code, not execution of the original Stata/R pipeline. The actual retention and first-review comparisons are in `output/reproduced/official_retention_contrast.csv` and `official_performance_contrast.csv`; their mode, sample sizes, units, inference and limitations are separate from B.

To rerun A, follow `README.md` and retrieve the verified files to an external directory under the release terms. The adapter checks hashes and rounding tolerances; a failure stops it. Do not guess missing variable names, join anonymized outcome files by row order, or reconstruct identities. A file's row number is not a common employee key. If A is inaccessible in your session, document that observation and complete B with its correct label.

## Diagnose

The experiment assigns an **offer** of the Wednesday/Friday home-work schedule by birthday parity. Actual use is a response to that offer. A comparison of people who choose to work at home with people who do not is not automatically causal. The two parity categories are not two independent workplace clusters on which to base mechanical cluster-robust inference.

Open `output/reproduced/outcome_ledger.csv`. It distinguishes quitting, satisfaction, reviews, promotion and task output. For each row, inspect the unit, reference population, time horizon, exposure, denominator, missingness, record producer and permitted interpretation. The ledger records quantities from the paper; its sample information is not reverse-engineered from rounded quitting rates.

1. Explain why exit belongs in the employment ledger even when post-exit output is unavailable. Why is assigning zero to that missing output misleading?
2. Contrast the original assignment denominator with the available-review denominator. Is an outcome comparison among survivors the full population effect on performance?
3. Distinguish no statistically detected difference from equivalence. The paper's review tests use two one-sided Welch tests at 5%, with bounds of ±0.5 grade points on a 1–5 scale. Passing those tests supports equivalence within that margin for the measured outcome and observed population; it does not establish an exactly zero effect.
4. Why do significance in one subgroup and non-significance in another not establish a difference between their effects? State the comparison that would test heterogeneity directly.
5. Apply the ledger to The Value of Bosses. What would you need to know about worker moves, manager assignment, demand, team composition and evaluation to interpret a manager coefficient? Manager fixed effects alone do not identify causal manager quality.

The internal provenance notes flag two source details: an inconsistency in the promotion-equivalence prose, and a first-review mean in the original R summary-input script that differs from the tabular release. The bounded adapter computes the selected review test from the observed release rather than hard-coding the source summary inputs. It does not claim an all-outcome replication.

## Transfer

Run `src/transfer-personnel-measurement.py` or the smoke command. It creates **Synthetic teaching example — not an empirical estimate**, using seed 20260920. Each scenario has 240 active workers in eight teams and two periods. Replacement also retains exited and not-yet-entered rows, so the combined ledger contains 1,560 scenario-worker-period observations. The artificial type is measured before the scenario change; it is not inferred from post-change output.

All three raw mean counts rise from 120 to 130 tasks per worker-period:

| Scenario | What changes? | Diagnostic prediction |
|---|---|---|
| Within-worker | Every incumbent produces ten more tasks; composition and quality stay fixed | Raw, baseline-type standardized and same-incumbent counts rise |
| Replacement | Sixty low-type workers leave and sixty high-type workers enter; type production functions stay fixed | Only raw counts rise; standardized and same-incumbent counts do not |
| Recorded counts | Ten extra recorded tasks coincide with a lower accepted-quality share | Counts rise even among the same workers; accepted task equivalents do not |

`scenario_comparison.csv` reports means and changes, the supported cells, employment counts and composition. Standardization weights the post-period low/high type means by their baseline shares, one-half each. Both type cells exist in both periods; the script refuses unsupported extrapolation. It does not condition on a variable affected by the scenario change. The same-incumbent comparison joins the two periods one-to-one and excludes entrants and leavers from that contrast, while preserving them in the ledger.

Inspect `output/transfer/scenario-comparison.png` and `transfer_memo.md`. Explain why the same-incumbent result still need not be causal in real data. Then modify one parameter in a copy of the script: the replacement share, the within-worker increment, or the recorded-count/quality relationship. Predict the changes before rerunning. Keep provenance labels and missing post-exit outcomes intact.

For each mechanism, name one additional record and one credible source of variation. A task audit can improve measurement without randomizing a policy. An assignment experiment can identify an offer effect without making a performance rating a complete measure of output or welfare.

## Submission

Submit the two status records if A was rerun, or the Mode B status plus your access note; the published-statistic arithmetic; one annotated outcome ledger; one synthetic scenario table or figure; and a one-page memo. The memo should separate what was executed, what the comparisons establish, and what extra data/design a real organization would require. Report which parameters you changed, if any, and include a short run log.

Evaluation emphasizes accurate provenance and arithmetic, coherent denominators, a correct diagnosis of composition/measurement, and a bounded identification proposal. Running synthetic code successfully cannot certify an unexecuted official replication.
