# Week 4 lab: evaluate the compensation rule

## Economic question and learning objectives

How do formal pay rules and informal commitments change effort, risk, selection and cooperation? By the end of the lab, you should be able to replay a compensation rule from a contract ledger, estimate an offered-bonus effect at the assignment unit, diagnose outcome-selected payout comparisons, and design an incentive reform that distinguishes at least two mechanisms.

The applied anchor is Friebel et al. (2017), on team incentives in a retail chain. Leaver et al. (2021) is the transfer anchor for recruitment versus post-entry incentives. The theoretical exercises are original teaching constructions motivated by the contract readings. Their numerical values are not published estimates or reproductions of an author's full model.

## Setup and provenance

From the lab root:

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

The executed mode is **synthetic design reconstruction**, recorded as `synthetic_design_reconstruction` with `empirical_replication: false`. All CSVs carry **`SYNTHETIC_TEACHING_NOT_PUBLISHED_ESTIMATES`**. The optional original-data route was omitted. The supplied pack documented archive listings; no original microdata or original replication code were downloaded or executed for this lab. A listed archive does not establish access or successful replication.

The standard-library generator creates data and readable results. Smoke executes it in two fresh same-seed roots and an additional seed, verifies substantive arithmetic and compares generated bytes. It does not merely trust a saved pass flag. Keep the synthetic truth files in `data/instructor_only/` separate from estimation inputs: pedagogical separation matters even though no record represents a real worker or shop.

## Reproduce: assignment to an offered team bonus

### Construct the contract ledger

Open `data/teaching/contract-schema.csv` and `shop_week.csv`. There are 24 invented shops in 12 matched pairs, followed for 12 weeks. Weeks 1–6 precede treatment and weeks 7–12 follow it. One shop per pair is randomly assigned a bonus offer; the assignment and each shop's target are fixed throughout the panel. These counts and the schedule belong to the toy design, not Friebel et al.'s experiment.

For each shop-week distinguish:

1. `assigned_bonus_offer`, fixed assignment to the rule;
2. `eligible_now`, assignment interacted with the post period;
3. `frozen_target`, the threshold set before work;
4. `gross_sales`, the realized performance measure;
5. `bonus_received` and `bonus_paid`, payment determined by the rule and realized sales.

The rule pays 120 currency units if a currently eligible shop reaches its target, including equality. Replay every payout. Find a shop-week that exceeds the target but receives no bonus because eligibility is absent. Neither a control shop nor a pre-period observation earns this invented bonus merely by meeting the target. Actual payout dates and contract awareness are not simulated: a prospective study should collect both, together with announcement and work dates.

The primary outcome, chosen before viewing results, is **gross sales**. Paid hours, return costs, payroll and accounting contribution are secondary. Payroll is $14\times\text{paid hours}+\text{bonus paid}$; contribution is $0.45\times\text{gross sales}-\text{return costs}-\text{payroll}$. Contribution excludes other costs and is not full profit or worker welfare. Hours do not directly measure effort, and return costs are a quality-related outcome rather than an independent quality audit.

### Estimate at the randomized unit

For each shop, calculate mean post outcome minus mean pre outcome. For each pair, subtract the control shop's change from the assigned shop's change. Average the twelve contrasts with equal pair weights:

```{math}
\widehat\tau=\frac{1}{12}\sum_{p=1}^{12}(\Delta Y_{p,T}-\Delta Y_{p,C}).
```

The reported SE is the sample standard deviation of the twelve pair contrasts divided by $\sqrt{12}$. Inspect `output/reproduced/pair-contrasts.csv` and `paired_itt.csv`. Explain why a pooled shop-week standard error would ignore the assignment design. The pair SE is a sampling summary; twelve pairs do not automatically justify a normal approximation.

Under the **sharp null of no assignment effect on any shop**, no cross-shop interference and this declared paired assignment, enumerate all $2^{12}=4096$ within-pair swaps. Hold the observed outcomes fixed. The two-sided p-value is the fraction with absolute mean contrast at least as large as the observed absolute mean. The observed assignment is included; there is no Monte Carlo approximation. Verify that all-zero contrasts give p = 1 and reversing every contrast's sign leaves the two-sided p-value unchanged.

This is not a general test of every heterogeneous zero-average-effect null. Do not permute shop-week rows, substitute these pairs for an original paper's design, or treat secondary p-values as four additional confirmatory results: they are explicitly unadjusted. Name the target, weights, assignment support and outcome family in your write-up.

## Diagnose: mechanisms and common interpretation errors

### 1. Receipt is selected on output

`data/teaching/receipt_null.csv` contains 160 invented units in 80 pairs with identical potential output within each pair. One member receives an offer. Payment additionally requires output of at least 100, while the true effect of the offer is zero for every unit. Compare outcomes by assignment and then by realized receipt. `output/transfer/receipt_diagnostic.csv` reports an assignment contrast of zero alongside a positive recipient association.

Which variable does the recipient comparison condition on? Why does a first-stage regression not automatically make payout exogenous? Here the outcome helps determine receipt; the recipient association is not an incentive effect. Never add the separate instructor truth fields as predictors to manufacture an empirical identification claim.

### 2. Insurance and marginal rewards require explicit assumptions

`output/reproduced/marginal_rewards.csv` implements $20+0.1m+5I(m\geq100)$. Calculate pay gains for 98→99, 99→100 and 100→101: 0.1, 5.1 and 0.1. A large reward at a threshold differs from a higher slope everywhere. Bunching or end-period sales timing alone does not establish an RD; discuss manipulation, discounts, returns and delayed outcomes.

`principal_agent.csv` uses the one-task CARA-normal teaching model with $p=k=\rho=1$, interior effort $e=kb$, freely adjustable fixed pay and a binding certainty-equivalent outside option of 2. The conditional optimum is $b=pk/(k+\rho\sigma^2)$; the risk premium is $\rho b^2\sigma^2/2$. Verify $b=0.5$ at noise variance 1 and $b=0.2$ at variance 4, and verify participation after fixed pay adjusts.

There is no selection or limited liability in this exercise. The saved optimum is **conditional on operating**. With the chosen outside option, all tabulated employer profits are negative; these choices do not establish that an employment relationship would operate. A comparison of reward slopes alone cannot establish worker welfare, optimal adoption or full social surplus.

### 3. Measured quantity is not total value

`output/transfer/multitask.csv` solves a two-task quadratic-cost model with cross-cost parameter $\kappa=0.6$. Its positive-definite cost matrix and nonnegative interior efforts are assumptions. Reward slopes $(0.8,0.8)$ give efforts $(0.5,0.5)$. Raising only the first slope to 1.2 gives $(1.125,0.125)$: measured quantity rises while gross value $e_1+2e_2$ falls from 1.5 to 1.375. Raising both slopes to one gives $(0.625,0.625)$ and gross value 1.875.

Recalculate variable pay and effort cost, and distinguish gross value from net profit and worker welfare. Explain why the additional cost-complement case, $\kappa=-0.2$, raises the second effort when the first reward increases. Task crowding out is a model implication under substitution, not a universal empirical fact. The code rejects an inadmissible negative-effort interior solution. Use the chapter's reproducible multitask figure to communicate this mechanism without claiming an estimated production function.

### 4. Composition arithmetic is not causal identification

`selection_accounting.csv` moves type shares from $(0.3,0.7)$ to $(0.6,0.4)$ and type output from $(12,8)$ to $(14,9)$. Mean output rises from 9.2 to 12.0. Within-type change evaluated at old shares contributes 1.3; composition evaluated at new outcomes contributes 1.5. Verify that the components sum to 2.8 and state that decomposition convention.

Types and counterfactual outcomes are known by construction here. Real personnel records do not automatically reveal them. In Leaver et al., recruiting-market and school-level variation play different roles; pupil learning is not directly observed latent teacher effort. Explain what additional variation would separate entry, incumbent response and retention in your setting. Worker fixed effects and a stayer-only sample do not by themselves solve endogenous composition.

### 5. Promised generosity is not payment credibility

`relational_constraint.csv` evaluates the employer-side payment condition $B\leq d\Delta\Pi/(1-d)$, with $d=\delta s$. For $B=3$ and $\Delta\Pi=1$, the boundary is $d=0.75$; 0.8 satisfies the inequality and 0.6 does not. Recompute the continuation values and inspect the flag that full equilibrium is not established.

This is a necessary employer payment condition in the simplified environment. It does not establish worker incentive compatibility, full equilibrium, identified trust or empirically measured discount factors. List the missing worker-side and continuation conditions before proposing a field interpretation. Reciprocity, relational enforcement and self-commitment remain distinct mechanisms.

## Transfer: an incentive-reform proposal

Complete `transfer-memo-template.md`: two pages plus a compact data/contract dictionary. Propose a change to a compensation rule, such as quantity-only versus balanced rewards after a common technology change. Another application holds the nominal promise fixed and studies a credible guarantee. Define the information available before work and retain the baseline eligible population through participation and exit.

Specify at least two competing mechanisms, each with a prediction and a potential falsifier. Choose a primary outcome, an independently recorded quality outcome, participation/exit and a worker-welfare outcome absent from this toy dataset. Explain assignment, risk set, timing, selection, interference, multiplicity and delayed measurement. State what your design can learn about incentives versus composition and what remains unknown about optimality and welfare.

Classify proposed data as public, restricted, requiring a partnership, or unavailable. This assignment requires a research proposal, not a new firm agreement or original-record acquisition. Do not propose causing harmful breaches of commitments to create variation.

## Submission and reproducibility

Submit the contract dictionary and source/mode ledger; paired primary estimate and inference explanation; brief diagnostic calculations; the proposal and data dictionary; and a run log with command, seed and any modifications. Label every synthetic output. Explain the economic assumption behind each successful numerical check: passing arithmetic is not evidence about an original paper's effect size or a worker's welfare.
