Spaces:
Running
Running
|
Download METHODOLOGY.md from Hugdrigo/impactlab-latam: direct link, hf CLI and curl.
- Browser
- Download file 3.99 kB
-
https://huggingface.co/spaces/Hugdrigo/impactlab-latam/resolve/main/METHODOLOGY.md
- Command line
-
hf download hf://spaces/Hugdrigo/impactlab-latam/METHODOLOGY.md
-
curl -L -o METHODOLOGY.md https://huggingface.co/spaces/Hugdrigo/impactlab-latam/resolve/main/METHODOLOGY.md
3.99 kB
| # Methodology and estimator specification | |
| ## 1. Research design | |
| An observation is a `(ISO3 economy, indicator, year, numeric value)` tuple. A researcher chooses treated economy `T`, donor economies `C`, outcome `Y`, start year `s`, break year `b`, and end year `e`. Year `b` is treated as the first post-break year. It is a **user-defined hypothesis**, not a verified policy event. | |
| ## 2. Matched-year panel | |
| A year is paired only when the treated economy and **every** selected donor has a finite observation. The donor comparison value in a paired year is the *equal-weight arithmetic average* of selected donor values. No interpolation or substitution is performed. Data completeness is shown separately. | |
| ## 3. Difference-in-Differences | |
| Given paired years partitioned into `PRE` (`year < b`) and `POST` (`year >= b`): | |
| ``` | |
| ΔT = mean(Y_T,POST) - mean(Y_T,PRE) | |
| ΔC = mean(Y_C,POST) - mean(Y_C,PRE) | |
| DiD = ΔT - ΔC | |
| ``` | |
| Both segments require at least three paired years. This is an aggregated two-group, two-period contrast; it is **not** a panel-regression estimate with fixed effects or clustered errors. The pretrend diagnostic fits a simple ordinary least-squares slope to each pre-break series, subtracting donor slope from treated slope. A small observed difference does not verify parallel trends. | |
| ## 4. Descriptive year resampling | |
| The algorithm uses deterministic pseudorandom resampling of matched calendar years *within* pre/post segments, 400 draws with a fixed seed (`20261008`). It recomputes the mean yearly treated-donor gap difference on each draw and presents the 2.5 and 97.5 percentile range. Serial correlation is **not** accounted for; this is a descriptive sensitivity range, **not** a causal confidence interval or valid hypothesis test. | |
| ## 5. Synthetic comparison | |
| With donor matrix `X` and treated vector `y` over **shared pre-break years**, minimize: | |
| ``` | |
| mean((y - Xw)^2) + λ Σ(w_j^2) | |
| subject to w_j >= 0 and Σ w_j = 1 | |
| ``` | |
| Inputs are rescaled by the treated pre-break root mean square for numerical stability. The code uses a projected-gradient method with simplex projection, ridge parameter `λ=0.001` and up to 1,000 updates. It may not reach a globally certified tolerance for ill-conditioned panels; audit pre-break fit. Synthetic control requires at least two donors, five shared pre-break years and two shared post-break years. It reports donor weights, pre/post RMSE, mean post-break gap and the post/pre RMSE ratio when defined. **It does not perform the original Abadie et al. synthetic-control optimization with covariates or statistical inference.** | |
| ## 6. Placebo diagnostics | |
| ### Country assignment | |
| Each selected economy is made the pseudo-treated country and compared with the other selected economies using the same convex method, subject to coverage rules. This is a descriptive group of in-space placebos, not randomization inference. The small donor count strongly limits interpretability. | |
| ### Historical fake intervention dates | |
| Candidate break years at least three years after the start and three years before the actual assumed break are used with a truncated pre-event period. The same DiD contrast is recomputed to reveal whether similar changes appear in earlier periods. No p-value is calculated. | |
| ## 7. Threats to validity | |
| Confounders, policy spillovers, endogenous treatment assignment, anticipation, coincident shocks, unstable measures, donor selection, temporal dependence and low statistical power are not resolved by the application. A convincing policy study would require documented events, domain-specific design, proper inference and independent replication. | |
| ## 8. Numerical reproducibility | |
| All estimator functions are published in `engine.js` with Node tests in `test_engine.cjs`. Demo data are generated deterministically in `demo-data.js`. Exports include the exact observations used, design choices, warnings and notes. Use the included session JSON to preserve an experiment before closing the browser. | |