* stata_codebook.do - attach long-form notes to the .dta files (run once in Stata). * Generated by build_data_dictionary.py - do not edit by hand. * ---- fwl_store_data.dta ---- use "fwl_store_data.dta", clear label data "Simulated restaurants, January: sales, coupons, income, day of week" note _dta: Simulated by script.py with numpy default_rng(42) (PCG64): income ~ N(50, 10); dayofweek uniform on 1-7; coupons = 60 - 0.5 x income + N(0, 5); sales = 10 + 0.2 x coupons + 0.3 x income + 0.5 x dayofweek + N(0, 3). True coupon effect +0.2. sales, coupons and income rounded to 2 decimals. note sales: Monthly sales of the restaurant - the outcome variable. One unit is 1,000 US dollars. Construction: sales = 10 + 0.2 x coupons + 0.3 x income + 0.5 x dayofweek + e, e ~ N(0, 3); computed from the unrounded draws, then rounded to 2 decimals. Units: thousands of US dollars. Source: Simulation (script.py, seed 42) note coupons: Share of the restaurant's 100 coupons, handed out on one day, that were redeemed during the month, in percent - the treatment (regressor of interest). Its true effect on sales is +0.2 per percentage point. Construction: coupons = 60 - 0.5 x income + u, u ~ N(0, 5); rounded to 2 decimals. Wealthier neighborhoods redeem fewer coupons. In June (panel) the persistent restaurant trait is added. Units: percent. Source: Simulation (script.py, seed 42) note income: Income of the restaurant's neighborhood - the confounder: it lowers the redemption rate (-0.5 per unit) and raises sales (+0.3 per unit). Construction: income ~ N(50, 10); in June (panel) January income + N(0, 2); rounded to 2 decimals. Units: thousands of US dollars. Source: Simulation (script.py, seed 42) note dayofweek: Day-of-week index, an integer from 1 to 7. It shifts sales (+0.5 per step) but is unrelated to coupons by construction; the post adds it as a second control. No weekday names are attached to the codes. Construction: rng.integers(1, 8): uniform on the integers 1 to 7 (the upper bound 8 is exclusive). Units: index 1-7. Source: Simulation (script.py, seed 42) save "fwl_store_data.dta", replace * ---- fwl_restaurant_panel.dta ---- use "fwl_restaurant_panel.dta", clear label data "Simulated restaurants, January + June panel" note _dta: Simulated by simulate_restaurant_panel() in script.py with numpy default_rng(42): January rows equal fwl_store_data.csv; June adds income + N(0, 2), a summer sales lift of +3, and a persistent restaurant trait (January's sales noise) that also raises June redemption. True coupon effect +0.2 in both months. note restaurant_id: Restaurant identifier, 1 to 50, in the order the restaurants were drawn. Panel file only; row i of fwl_store_data is restaurant_id i. Construction: np.arange(1, n + 1). Units: id. Source: Simulation (script.py, seed 42) note period: Month in which the restaurant handed out its 100 coupons: 1 = January (the main-body data), 2 = June. Panel file only. Construction: 1 for the January rows, 2 for the June rows. Units: code. Source: Simulation (script.py, seed 42) note sales: Monthly sales of the restaurant - the outcome variable. One unit is 1,000 US dollars. Construction: sales = 10 + 0.2 x coupons + 0.3 x income + 0.5 x dayofweek + e, e ~ N(0, 3); computed from the unrounded draws, then rounded to 2 decimals. Units: thousands of US dollars. Source: Simulation (script.py, seed 42) note coupons: Share of the restaurant's 100 coupons, handed out on one day, that were redeemed during the month, in percent - the treatment (regressor of interest). Its true effect on sales is +0.2 per percentage point. Construction: coupons = 60 - 0.5 x income + u, u ~ N(0, 5); rounded to 2 decimals. Wealthier neighborhoods redeem fewer coupons. In June (panel) the persistent restaurant trait is added. Units: percent. Source: Simulation (script.py, seed 42) note income: Income of the restaurant's neighborhood - the confounder: it lowers the redemption rate (-0.5 per unit) and raises sales (+0.3 per unit). Construction: income ~ N(50, 10); in June (panel) January income + N(0, 2); rounded to 2 decimals. Units: thousands of US dollars. Source: Simulation (script.py, seed 42) note dayofweek: Day-of-week index, an integer from 1 to 7. It shifts sales (+0.5 per step) but is unrelated to coupons by construction; the post adds it as a second control. No weekday names are attached to the codes. Construction: rng.integers(1, 8): uniform on the integers 1 to 7 (the upper bound 8 is exclusive). Units: index 1-7. Source: Simulation (script.py, seed 42) save "fwl_restaurant_panel.dta", replace