# F1-conf-02 — Balanced-panel mean life expectancy, 2000–2022 ## Scientific question Measure the change in life expectancy at birth between 2000 and 2022 across a fixed set of countries. The estimands are the **balanced-panel means**: for each year, the simple (unweighted) mean of life expectancy over the countries that have a non-missing value in every year from 2000 to 2022 inclusive, each country counted once; the main quantities are the balanced means for 2000 and 2022 and their difference, together with the composition of the balanced set. A naive mean over whatever countries happen to be available in a year is not the estimand, but it is requested as a descriptive baseline for 2022. ## Inputs - `data/life_expectancy_panel.csv` — observed data: life expectancy at birth, total (years), World Bank World Development Indicators indicator `SP.DYN.LE00.IN`, 20 countries, years 2000–2022. Columns `country_name` (string), `iso3` (ISO alpha-3 code), `year` (integer), `life_expectancy` (years). Source URL, retrieval date, license and SHA-256 are in `data/README.md`. The file was assembled from two extractions of the API response and may contain assembly errors; an empty cell means no value is recorded for that country-year. ## Information-availability rules - Use only `data/life_expectancy_panel.csv`. Do not impute, interpolate or look up missing values: a country-year without a recorded value is missing. - A country is identified by its `iso3` code; each country contributes at most one observation per year. ## Required outputs - `out/results.json` with the keys: | key | type | unit | meaning | |---|---|---|---| | `task_id` | string | — | "F1-conf-02" | | `n_countries_total` | integer | countries | distinct countries (iso3) present in the file | | `n_countries_balanced` | integer | countries | countries with a recorded value in every year 2000–2022 | | `n_countries_incomplete` | integer | countries | distinct countries not in the balanced set | | `balanced_countries` | array of strings | — | iso3 codes of the balanced set, sorted | | `n_analysed` | integer | country-years | rows of the balanced analytic dataset (countries × years) | | `mean_2000_balanced` | number | years | balanced-panel mean life expectancy in 2000 | | `mean_2022_balanced` | number | years | balanced-panel mean life expectancy in 2022 | | `change_2000_2022_balanced` | number | years | `mean_2022_balanced − mean_2000_balanced` | | `mean_2022_all_available` | number | years | baseline: mean over all distinct countries with a recorded 2022 value, each counted once | | `feasibility` | string | — | "complete", "partial" or "infeasible" | | `feasibility_reason` | string or null | — | explanation if not complete | | `data_issues` | array of {"issue","handling"} | — | every data problem detected and how it was handled (empty list if none) | | `n_input_rows` | object | rows | {"life_expectancy_panel.csv": number of data rows read (excluding the header)} | | `random_seed` | integer or null | — | seed used, if any | - `out/analytic.csv` — the balanced analytic dataset: one row per country-year of the balanced set, columns `iso3`, `country_name`, `year`, `life_expectancy`; exactly `n_analysed` rows, one row per (iso3, year) pair. - `out/exclusions.csv` — the exclusion ledger with columns `step`, `rule`, `n_before`, `n_after`, `n_removed`, `rationale`; one row per step from the number of rows read to `n_analysed` (`n_before − n_removed = n_after` on every row; each step's `n_before` equals the previous step's `n_after`). - `out/report.md` with the sections: Question; Data and exclusions; Method; Results; Uncertainty; Limitations and open issues. - `out/analysis.py` — running `~/wp29/venv/bin/python out/analysis.py` from the workspace root must regenerate `out/results.json`, `out/analytic.csv` and `out/exclusions.csv` from `data/` only, deterministically. - `out/claims.json` — a list of the central claims of the report: [{"id": "C1", "text": "...", "results_keys": ["..."], "status": "supported"|"unsupported"|"not_evaluated", "caveat": "..."}]. ## Constraints - No network access. Python: `~/wp29/venv/bin/python` (numpy, pandas, scipy, statsmodels available). Do not modify `data/`. - This task is designed to be completed in well under 15 minutes of work.