[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M699889N8GKCXQ195YBQZ4DB":3,"skill-same:01M699889N8GKCXQ195YBQZ4DB":90},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":51,"linkOnly":52,"markdownContent":53,"markdownBody":54,"frontMatter":55,"refName":56,"commitSha":57,"skillDirectory":58,"forksCount":59,"repositoryHtmlUrl":60,"repositoryHomepageUrl":61,"ownerHtmlUrl":62,"ownerBlogUrl":63,"ownerDescription":64,"updatedAt":65,"install":66,"resources":79},"01M699889N8GKCXQ195YBQZ4DB","causal-insights","DoubleML 因果洞察分析","Interprets completed doubleml-pipeline output directories across treatments, outcome KPIs, entity dimensions (geo_col, item_col), calendar periods, and CATE covariates, turning Double Machine Learning estimates into causal insight reports, ROI or effect-per-unit verdicts, and resource allocation recommendations. Use when pointing at a doubleml-pipeline output_dir (containing metadata.json and step4_consolidated_results\u002F) or when asked which treatments paid back, where or when effects are strongest, what drives effect heterogeneity, whether estimates are trustworthy, or how to reallocate budget. Don't use for fitting new DoubleML models, running raw regressions on input CSVs, or forecasting non-causal time series.","解读已完成的 doubleml-pipeline 输出目录，涵盖处理变量（treatment）、结果 KPI、实体维度（geo_col、item_col）、日历周期和 CATE 协变量，将双重机器学习（Double Machine Learning）估计转化为因果洞察报告、ROI 或单位效果结论，以及资源分配建议。当指向 doubleml-pipeline 的 output_dir（包含 metadata.json 和 step4_consolidated_results\u002F）时使用，或被问及哪些处理有回报、效果在何处或何时最强、什么驱动效果异质性、估计是否可信、如何重新分配预算时使用。不用于拟合新的 DoubleML 模型、对输入 CSV 运行原始回归，或预测非因果时间序列。","google\u002Fdoubleml-pipeline","google","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1342004?v=4","01M698VYEFDM0VJBZDYYJ2T83S","Google","01M69986JD0MX57SMQCVN5PDF3",109,"Apache-2.0",null,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fdoubleml-pipeline\u002Fblob\u002Fmain\u002Fskills\u002Fcausal-insights\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQGD4CMBM6B4PWSM1NXGT9","数据分析与报告","SCENARIO","使用场景",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQGD5CX980XNXCJKQF70BY","数据分析师","PROFESSION","适用职业",[31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50],"insights","causal insights","across","effects","at","which","directories","unit","resource allocation","how to","recommendations","time","dimensions","back","reports","calendar","outcome","effect","how","pipeline","2026-11-10 10:12:30",false,"---\nname: causal-insights\ndescription: >-\n  Interprets completed doubleml-pipeline output directories across treatments,\n  outcome KPIs, entity dimensions (geo_col, item_col), calendar periods, and\n  CATE covariates, turning Double Machine Learning estimates into causal insight\n  reports, ROI or effect-per-unit verdicts, and resource allocation\n  recommendations. Use when pointing at a doubleml-pipeline output_dir\n  (containing metadata.json and step4_consolidated_results\u002F) or when asked\n  which treatments paid back, where or when effects are strongest, what drives\n  effect heterogeneity, whether estimates are trustworthy, or how to reallocate\n  budget. Don't use for fitting new DoubleML models, running raw regressions on\n  input CSVs, or forecasting non-causal time series.\n---\n\n# Causal Insight Analysis for `doubleml-pipeline` Outputs\n\nThe pipeline has already estimated debiased causal effects with Double Machine\nLearning (DML). Read the completed `output_dir` files directly using the exact\nmetric definitions in\n[references\u002Fmetric_formulas.md](references\u002Fmetric_formulas.md) — never refit raw\nregressions on the input panel.\n\n**Adapt to the run's schema (`metadata.json` first):** Treatments, channels,\ninterventions, outcome KPIs, entity dimensions (`geo_col`, `item_col`), and\ncovariates vary across users and domains (including non-monetary treatments with\nno spend column). Derive every lever name, unit type, segment label, and driver\nstrictly from `metadata.json` and the columns present in\n`consolidated_1a_full_df.csv` — never assume specific channels, treatments, or\ndomain constructs that are not in the data. When a question cannot be answered\nfrom the run's outputs, say so explicitly and name the exact pipeline setting\n(`treatment_cols`, `x_cols_list`, `covariates_for_cate_list`, `geo_col` \u002F\n`item_col`, `optimize=True`, or `run_sensitivity=True`) needed to answer it.\n\n## Output Directory Reading Order\n\nStep | File in `\u003Coutput_dir>` | What to extract\n:--- | :--------------------- | :--------------\n1 | `metadata.json` | `outcome_col`, `treatment_cols`, `treatment_types`, `treatment_spend_cols`, `x_cols_list`, `covariates_for_cate_list`, `geo_col`, `item_col`, `date_col`, `opt_threshold_roi` (`threshold_roi`), `saturation_family`, `saturation_phase0`, `phase4_optimization`, `cluster_dml`.\n2 | `step4_consolidated_results\u002Fconsolidated_1a_full_df.csv` | Row-level panel + `estimated_incremental_KPI_\u003Cd>`, `_2.5%`, `_97.5%`, `roi_amount_based_\u003Cd>`, and (saturation optimizer only) `optimized_\u003Cd>_spend` \u002F `optimized_incremental_KPI_\u003Cd>`. Aggregate all overall, segment, calendar, and driver slices from this table.\n3 | `step4_consolidated_results\u002Fgraph\u002F004_cate\u002Fcate_coef_dict_pooling.csv` | Pooled `model == \"median\"` row `cate_pvalue_dict` for Bonferroni-adjusted heterogeneity grades (`strong`, `weak`, `none`).\n4 | `step4_consolidated_results\u002Fconsolidated_3a_detail.csv` | Phase 3 repetition stability (`total_estimated_incremental_KPI` sign consistency and CV across `n_reps`).\n5 | `step4_consolidated_results\u002Fgraph\u002F006_sensitivity\u002Fsensitivity_metrics.csv` | OVB `robustness_value` vs. `benchmark_covariate` (`benchmark_cf_d`, `benchmark_cf_y`).\n6 | `step0_saturation\u002Fsummary_alpha_selection.json` & `diag6_t_ref_consistency.csv` | Phase 0 `decision` (`saturation` vs. `linear`), `decision_reason` (`1se_pass`, `1se_fail`, `grid_edge_upper`), `selected_family`, `alpha_hat`, `half_saturation_T`, `T_ref`, `d_bar`, `se`, `diag1_fired`, `diag2_fired`, `r_T`, `messages`. (Per-treatment subdirs when `len(treatment_cols) > 1`.)\n7 | `step4_consolidated_results\u002Fgraph\u002F007_optimization\u002F` or `roi_output\u002F\u003Cd>\u002F007_optimization\u002F` | `optimization_metrics.csv` and `optimization_yearly_summary.csv` (`spend` treatments use `graph\u002F007_optimization\u002F`; non-`spend` treatments with spend mapping use `roi_output\u002F\u003Cd>\u002F007_optimization\u002F`).\n\n--------------------------------------------------------------------------------\n\n## Four Non-Negotiable Calculation Rules\n\nAlways apply the formulas in\n[references\u002Fmetric_formulas.md](references\u002Fmetric_formulas.md) to avoid silent\ncalculation errors:\n\n1.  **Order row-level 95% bounds before summing:**\n    `estimated_incremental_KPI_\u003Cd>_2.5%` and `_97.5%` are `(T - zero_point) *\n    bound`, so they swap order whenever `T \u003C zero_point`. Always compute\n    `np.minimum(c25, c975).sum()` and `np.maximum(c25, c975).sum()`. Compute\n    `effect_per_unit` (and its ordered 95% interval) by dividing by `T.sum()`,\n    leaving it unset if a slice mixes positive and negative treatment values.\n2.  **Divide by monetary spend for ROI (`treatment_spend_cols`):** In\n    `consolidated_3b_summary*.csv`, `total_estimated_roi` is `incremental_kpi \u002F\n    total_input` (effect per raw unit of treatment `\u003Cd>`, NOT monetary ROI when\n    `treatment_types[d]` is `percentage`, `price`, `impressions`, or another\n    non-spend unit). Always compute monetary ROI from\n    `consolidated_1a_full_df.csv` by dividing `incremental_kpi` (and its ordered\n    95% bounds) by `df[treatment_spend_cols[d]].sum()` when spend is mapped\n    (otherwise report `effect_per_unit` and its 95% interval). Compare\n    `[roi_low, roi_high]` against `opt_threshold_roi`: `roi_high \u003C\n    threshold_roi` -> `not_worth_investing`; `roi_low > threshold_roi` ->\n    `worth_investing`; straddling -> `undetermined` (omit verdict if\n    `opt_threshold_roi` is `null` or no spend column exists). A `price`\n    treatment is estimated as a **gap** `benchmark price - price` (its column\n    is named `\u003Cprice>_gap`; `metadata[\"price_benchmarks\"][d]` gives the\n    benchmark, the benchmark column and the investment column), so\n    `effect_per_unit` is \"incremental KPI per currency unit of price cut\",\n    rows with a zero gap were sold at the benchmark price, and a negative gap\n    (price above the benchmark) counts as zero investment.\n3.  **Grade CATE heterogeneity from the `median` row with Bonferroni scaling:**\n    In `cate_coef_dict_pooling.csv` (`model == \"median\"`), match all basis\n    p-values for covariate `c` (`\u003Cc>_pvalue`, `bs(\u003Cc>, ...)`, `C(\u003Cc>)...`),\n    compute `p_adj = min(1.0, min(ps) * len(ps))`, and classify `\u003C 0.05` as\n    `strong (p=...)`, `\u003C 0.10` as `weak (p=...)`, and `>= 0.10` as `none\n    (p=...)` (quoting `p\u003C0.001` below `0.001`). Pooled BLP p-values ignore\n    first-stage estimation error, so treat them as an approximate grade rather\n    than a formal hypothesis test.\n4.  **Exclude synthetic ground truth and derived cluster columns:** Never read,\n    profile, or report `TrueContrib_*`, `total_ground_truth_KPI`,\n    `true_incremental_KPI_*`, `ground_truth_*`, `true_total_roi`, `SMAPE`,\n    `R_squared`, `MAE`, `RMSE`, or `metadata[\"ground_truth_metrics\"]` unless the\n    user explicitly asks to audit synthetic recovery. Exclude\n    `cluster_dml.derived_columns` (`cluster_date_block`) from driver analyses.\n\n**Allowed manual arithmetic & multi-run rule:** Break-even gross margin `1 \u002F\nroi_on_spend` when `outcome_col` represents gross revenue, and rescaling\n`effect_per_unit` to natural units (e.g., dividing by `100` when\n`treatment_types[d] == \"percentage\"` stored on `[0, 1]` to report per 1\npercentage point). Never invent margins or benchmarks (ask the user instead),\nand never extrapolate outside observed support. Across multiple `output_dir`\nruns estimated separately, compare side by side only when `outcome_col` matches,\nand **never** sum `incremental_kpi` across runs. Speak in plain domain terms\nmatching the user's column semantics and language without leaking internal\nschema keys.\n\n--------------------------------------------------------------------------------\n\n## 7-Step Analysis Playbook\n\nWork through the steps needed to answer the user's question. For a comprehensive\nreview, execute all applicable steps and follow\n[references\u002Freport_template.md](references\u002Freport_template.md).\n\n1.  **Frame the run:** Read `metadata.json` and inspect date frequency (`daily`,\n    `weekly`, `monthly`), row count, active entity axes (`geo_col`, `item_col`),\n    treatments (`treatment_cols`, `treatment_types`, `treatment_spend_cols`),\n    confounders (`x_cols_list`), `covariates_for_cate_list`,\n    `opt_threshold_roi`, `cluster_dml`, and Phase 0 \u002F Phase 4 flags.\n2.  **Headline causal impact:** Summarize total `spend` (or treatment volume)\n    and treated row count (**Fact:**), then `incremental_kpi` with 95% interval,\n    `roi_on_spend` (or rescaled `effect_per_unit`), `share_of_outcome`,\n    break-even margin (if revenue KPI), and payback verdict (**Inference:**).\n3.  **Where it works (`geo_col` & `item_col`):** Group\n    `consolidated_1a_full_df.csv` by each configured entity axis (`geo_col`,\n    `item_col`). Sort by `roi_on_spend` for efficiency questions or\n    `incremental_kpi` for volume questions. Check whether `geo_col` \u002F `item_col`\n    is in `covariates_for_cate_list`.\n4.  **When it works (calendar cadence):** When `date_col` is present, group by\n    month-of-year (and day-of-week when median date step \u003C= 2 days, plus\n    year-month or quarter for trajectory).\n5.  **What amplifies it (drivers & 2-D interactions):** Bin continuous drivers\n    with within-entity quantiles (`within_quantile_bins` in\n    [references\u002Fmetric_formulas.md](references\u002Fmetric_formulas.md), grouping by\n    `geo_col` or `item_col` when present) so each unit is judged against its own\n    baseline, and cross-tabulate 2-D interactions (e.g., a CATE covariate x\n    treatment intensity, or two covariates from the run).\n6.  **Can we trust it? (Diagnostics & raw segment profiles):** Check repetition\n    stability, OVB sensitivity (`robustness_value` vs. `max(benchmark_cf_d,\n    benchmark_cf_y)` overall and least-robust segments), Phase 0 saturation\n    diagnostics, `low_sample` (`\u003C 30` treated rows), and `plausibility_flags`.\n    Whenever two segments have non-overlapping 95% intervals (`ci_separation` on\n    `roi_on_spend` or `effect_per_unit`) or `plausibility_flags` fire, profile\n    that segment's raw data (`gap_in_row_sd`, `ratio_to_overall`,\n    `treated_share`, and treated `p25\u002Fp50\u002Fp75`) before interpreting.\n7.  **How should allocation move? (Optimization):** When `007_optimization\u002F`\n    exists, report historical vs. optimized spend, incremental KPI, and ROI\n    (total, by `geo_col` \u002F `item_col`, and yearly from\n    `optimization_yearly_summary.csv`), row counts shifted (`increased`,\n    `reduced`, `cut_to_zero`), reconciliation with `optimization_metrics.csv`,\n    and optimizer assumptions\u002Fwarnings. Never design custom allocations, scale\n    to unmodeled budgets, or shift budget across treatments or runs. If absent,\n    note that optimization requires a single-treatment run with `optimize=True`,\n    `date_col`, and spend mapping.\n\n--------------------------------------------------------------------------------\n\n## Causal & Domain Interpretation Rules\n\n-   **Reading 95% intervals:** Always lead with the point estimate and\n    `effect_direction` (`positive`, `negative`, `zero`). Aggregate 95% bands sum\n    row-level bounds conservatively and routinely span zero. **Never** call an\n    estimate \"statistically significant\", \"not significant\", \"inconclusive\", or\n    \"indistinguishable from zero\", and never use the words *significant* or\n    *p-value* in prose (except quoting CATE grades verbatim like `strong\n    (p=0.0022)` as an approximate heterogeneity grade).\n-   **Average vs. Marginal ROI:** `roi_on_spend` is the *average* return on past\n    spend. `worth_investing` justifies **keeping** historical spend;\n    `not_worth_investing` justifies **cutting\u002Fstopping**; `undetermined` calls\n    for a controlled test. Scaling budget *up* requires marginal returns from an\n    active saturation curve or KKT `optimization`. Under saturation, per-unit\n    effect naturally falls at higher spend along diminishing returns.\n-   **Column Role (`cate_covariate` | `confounder` | `unused`) & Constant-Effect\n    Runs:** Per-unit treatment effects vary **only** through\n    `covariates_for_cate_list`. If `covariates_for_cate_list` is empty, per-unit\n    effect is constant by construction and `incremental_kpi` differs across\n    slices only with treatment volume. If a slice column is `confounder` (in\n    `x_cols_list` only, including entity dummies) or `unused`, splitting by it\n    is **descriptive** — showing where effects landed via covariate mix and\n    intensity, not modeled slice-specific response. Say so explicitly and\n    recommend adding the column to `covariates_for_cate_list` to test it. Warn\n    against conditioning on post-treatment variables (columns moved by the\n    treatment itself) as targeting pre-conditions.\n-   **Confounding, Carryover & Spillover:** Inspect `x_cols_list` against the\n    other columns in `consolidated_1a_full_df.csv` to flag unadjusted concurrent\n    treatments or levers, intertemporal pull-forward or lagged carryover\n    effects (`_l\u003Ck>` lagged columns), and cross-unit spillover or substitution\n    across `geo_col` \u002F `item_col`.\n\n--------------------------------------------------------------------------------\n\n## Trust Checklist\n\nCheck | Required Action\n:---- | :--------------\n**Payback & multiplicity** | Keep `worth_investing`, cut `not_worth_investing`, test `undetermined`. Across many `geo_col` or `item_col` slices, ~2.5% per tail can cross `threshold_roi` by chance unless consistent across periods and repetitions.\n**Driver evidence** | Claim a covariate shifts per-unit response only when CATE grade is `strong` (quote verbatim, e.g., `strong (p=0.0022)`). Treat `weak` as a lead to validate and `none` as no modeled heterogeneity.\n**Plausibility & support** | Flag `\u003C 30` treated rows (`low_sample`) as directional only. If `incremental_kpi_exceeds_outcome`, `kpi_without_spend`, or `negative_spend` fires, treat that slice's estimate as unreliable and inspect raw segment profiles.\n**Model & Phase 0** | Caveat high repetition CV (`> 0.3`), mixed repetition signs, `robustness_value \u003C= max(benchmark_cf_d, benchmark_cf_y)` (passing rules out confounders only up to the strongest observed `x_col`), few clusters (`\u003C 30` in `cluster_dml.messages`), or Phase 0 warnings (`1se_fail`, `diag1_fired`, `diag2_fired`, low `r_T`, `fallback_half_saturation_T_used`).\n**Optimizer discipline** | Frame `optimization` strictly as a retrospective model-implied proposal (no carryover\u002Fadstock, point-estimate CATE, no 95% interval). State whether Phase 4 ran `saturation`, `simple`, or `linear_fallback`, warn if `kpi_after > 2.0 * kpi_before` (upper bound from cutting low-scored rows), if `kpi_before \u003C= 0 \u003C kpi_after`, or if `> 30%` of active units are cut to zero, and ask about operational floors\u002Fcontracts.\n\n--------------------------------------------------------------------------------\n\n## Mandatory Statement Tagging (`Fact:` \u002F `Inference:` \u002F `Hypothesis:`)\n\nStart **every bullet point** (and every standalone result sentence) with\n**exactly one** bold tag — never rely on section headers, and split mixed\nbullets:\n\n-   **Fact:** Raw input panel quantities (`spend`, observed KPI, row\u002Ftreated\n    counts, treatment intensity quantiles, bin cut points, covariate means).\n-   **Inference:** DML model outputs (`incremental_kpi`, 95% intervals,\n    `roi_on_spend`, payback verdicts, CATE evidence grades, sensitivity `RV`,\n    model-implied optimization numbers).\n-   **Hypothesis:** Proposed mechanism explaining *why* an inference occurred,\n    always paired with a concrete verification step (config change or holdout\n    experiment).\n\n## Bundled References\n\n-   Exact aggregation, ROI, CATE grading, diagnostics, and optimization\n    formulas: [references\u002Fmetric_formulas.md](references\u002Fmetric_formulas.md)\n-   Full causal review structure and statement-tagging examples:\n    [references\u002Freport_template.md](references\u002Freport_template.md)\n","# Causal Insight Analysis for `doubleml-pipeline` Outputs\n\nThe pipeline has already estimated debiased causal effects with Double Machine\nLearning (DML). Read the completed `output_dir` files directly using the exact\nmetric definitions in\n[references\u002Fmetric_formulas.md](references\u002Fmetric_formulas.md) — never refit raw\nregressions on the input panel.\n\n**Adapt to the run's schema (`metadata.json` first):** Treatments, channels,\ninterventions, outcome KPIs, entity dimensions (`geo_col`, `item_col`), and\ncovariates vary across users and domains (including non-monetary treatments with\nno spend column). Derive every lever name, unit type, segment label, and driver\nstrictly from `metadata.json` and the columns present in\n`consolidated_1a_full_df.csv` — never assume specific channels, treatments, or\ndomain constructs that are not in the data. When a question cannot be answered\nfrom the run's outputs, say so explicitly and name the exact pipeline setting\n(`treatment_cols`, `x_cols_list`, `covariates_for_cate_list`, `geo_col` \u002F\n`item_col`, `optimize=True`, or `run_sensitivity=True`) needed to answer it.\n\n## Output Directory Reading Order\n\nStep | File in `\u003Coutput_dir>` | What to extract\n:--- | :--------------------- | :--------------\n1 | `metadata.json` | `outcome_col`, `treatment_cols`, `treatment_types`, `treatment_spend_cols`, `x_cols_list`, `covariates_for_cate_list`, `geo_col`, `item_col`, `date_col`, `opt_threshold_roi` (`threshold_roi`), `saturation_family`, `saturation_phase0`, `phase4_optimization`, `cluster_dml`.\n2 | `step4_consolidated_results\u002Fconsolidated_1a_full_df.csv` | Row-level panel + `estimated_incremental_KPI_\u003Cd>`, `_2.5%`, `_97.5%`, `roi_amount_based_\u003Cd>`, and (saturation optimizer only) `optimized_\u003Cd>_spend` \u002F `optimized_incremental_KPI_\u003Cd>`. Aggregate all overall, segment, calendar, and driver slices from this table.\n3 | `step4_consolidated_results\u002Fgraph\u002F004_cate\u002Fcate_coef_dict_pooling.csv` | Pooled `model == \"median\"` row `cate_pvalue_dict` for Bonferroni-adjusted heterogeneity grades (`strong`, `weak`, `none`).\n4 | `step4_consolidated_results\u002Fconsolidated_3a_detail.csv` | Phase 3 repetition stability (`total_estimated_incremental_KPI` sign consistency and CV across `n_reps`).\n5 | `step4_consolidated_results\u002Fgraph\u002F006_sensitivity\u002Fsensitivity_metrics.csv` | OVB `robustness_value` vs. `benchmark_covariate` (`benchmark_cf_d`, `benchmark_cf_y`).\n6 | `step0_saturation\u002Fsummary_alpha_selection.json` & `diag6_t_ref_consistency.csv` | Phase 0 `decision` (`saturation` vs. `linear`), `decision_reason` (`1se_pass`, `1se_fail`, `grid_edge_upper`), `selected_family`, `alpha_hat`, `half_saturation_T`, `T_ref`, `d_bar`, `se`, `diag1_fired`, `diag2_fired`, `r_T`, `messages`. (Per-treatment subdirs when `len(treatment_cols) > 1`.)\n7 | `step4_consolidated_results\u002Fgraph\u002F007_optimization\u002F` or `roi_output\u002F\u003Cd>\u002F007_optimization\u002F` | `optimization_metrics.csv` and `optimization_yearly_summary.csv` (`spend` treatments use `graph\u002F007_optimization\u002F`; non-`spend` treatments with spend mapping use `roi_output\u002F\u003Cd>\u002F007_optimization\u002F`).\n\n--------------------------------------------------------------------------------\n\n## Four Non-Negotiable Calculation Rules\n\nAlways apply the formulas in\n[references\u002Fmetric_formulas.md](references\u002Fmetric_formulas.md) to avoid silent\ncalculation errors:\n\n1.  **Order row-level 95% bounds before summing:**\n    `estimated_incremental_KPI_\u003Cd>_2.5%` and `_97.5%` are `(T - zero_point) *\n    bound`, so they swap order whenever `T \u003C zero_point`. Always compute\n    `np.minimum(c25, c975).sum()` and `np.maximum(c25, c975).sum()`. Compute\n    `effect_per_unit` (and its ordered 95% interval) by dividing by `T.sum()`,\n    leaving it unset if a slice mixes positive and negative treatment values.\n2.  **Divide by monetary spend for ROI (`treatment_spend_cols`):** In\n    `consolidated_3b_summary*.csv`, `total_estimated_roi` is `incremental_kpi \u002F\n    total_input` (effect per raw unit of treatment `\u003Cd>`, NOT monetary ROI when\n    `treatment_types[d]` is `percentage`, `price`, `impressions`, or another\n    non-spend unit). Always compute monetary ROI from\n    `consolidated_1a_full_df.csv` by dividing `incremental_kpi` (and its ordered\n    95% bounds) by `df[treatment_spend_cols[d]].sum()` when spend is mapped\n    (otherwise report `effect_per_unit` and its 95% interval). Compare\n    `[roi_low, roi_high]` against `opt_threshold_roi`: `roi_high \u003C\n    threshold_roi` -> `not_worth_investing`; `roi_low > threshold_roi` ->\n    `worth_investing`; straddling -> `undetermined` (omit verdict if\n    `opt_threshold_roi` is `null` or no spend column exists). A `price`\n    treatment is estimated as a **gap** `benchmark price - price` (its column\n    is named `\u003Cprice>_gap`; `metadata[\"price_benchmarks\"][d]` gives the\n    benchmark, the benchmark column and the investment column), so\n    `effect_per_unit` is \"incremental KPI per currency unit of price cut\",\n    rows with a zero gap were sold at the benchmark price, and a negative gap\n    (price above the benchmark) counts as zero investment.\n3.  **Grade CATE heterogeneity from the `median` row with Bonferroni scaling:**\n    In `cate_coef_dict_pooling.csv` (`model == \"median\"`), match all basis\n    p-values for covariate `c` (`\u003Cc>_pvalue`, `bs(\u003Cc>, ...)`, `C(\u003Cc>)...`),\n    compute `p_adj = min(1.0, min(ps) * len(ps))`, and classify `\u003C 0.05` as\n    `strong (p=...)`, `\u003C 0.10` as `weak (p=...)`, and `>= 0.10` as `none\n    (p=...)` (quoting `p\u003C0.001` below `0.001`). Pooled BLP p-values ignore\n    first-stage estimation error, so treat them as an approximate grade rather\n    than a formal hypothesis test.\n4.  **Exclude synthetic ground truth and derived cluster columns:** Never read,\n    profile, or report `TrueContrib_*`, `total_ground_truth_KPI`,\n    `true_incremental_KPI_*`, `ground_truth_*`, `true_total_roi`, `SMAPE`,\n    `R_squared`, `MAE`, `RMSE`, or `metadata[\"ground_truth_metrics\"]` unless the\n    user explicitly asks to audit synthetic recovery. Exclude\n    `cluster_dml.derived_columns` (`cluster_date_block`) from driver analyses.\n\n**Allowed manual arithmetic & multi-run rule:** Break-even gross margin `1 \u002F\nroi_on_spend` when `outcome_col` represents gross revenue, and rescaling\n`effect_per_unit` to natural units (e.g., dividing by `100` when\n`treatment_types[d] == \"percentage\"` stored on `[0, 1]` to report per 1\npercentage point). Never invent margins or benchmarks (ask the user instead),\nand never extrapolate outside observed support. Across multiple `output_dir`\nruns estimated separately, compare side by side only when `outcome_col` matches,\nand **never** sum `incremental_kpi` across runs. Speak in plain domain terms\nmatching the user's column semantics and language without leaking internal\nschema keys.\n\n--------------------------------------------------------------------------------\n\n## 7-Step Analysis Playbook\n\nWork through the steps needed to answer the user's question. For a comprehensive\nreview, execute all applicable steps and follow\n[references\u002Freport_template.md](references\u002Freport_template.md).\n\n1.  **Frame the run:** Read `metadata.json` and inspect date frequency (`daily`,\n    `weekly`, `monthly`), row count, active entity axes (`geo_col`, `item_col`),\n    treatments (`treatment_cols`, `treatment_types`, `treatment_spend_cols`),\n    confounders (`x_cols_list`), `covariates_for_cate_list`,\n    `opt_threshold_roi`, `cluster_dml`, and Phase 0 \u002F Phase 4 flags.\n2.  **Headline causal impact:** Summarize total `spend` (or treatment volume)\n    and treated row count (**Fact:**), then `incremental_kpi` with 95% interval,\n    `roi_on_spend` (or rescaled `effect_per_unit`), `share_of_outcome`,\n    break-even margin (if revenue KPI), and payback verdict (**Inference:**).\n3.  **Where it works (`geo_col` & `item_col`):** Group\n    `consolidated_1a_full_df.csv` by each configured entity axis (`geo_col`,\n    `item_col`). Sort by `roi_on_spend` for efficiency questions or\n    `incremental_kpi` for volume questions. Check whether `geo_col` \u002F `item_col`\n    is in `covariates_for_cate_list`.\n4.  **When it works (calendar cadence):** When `date_col` is present, group by\n    month-of-year (and day-of-week when median date step \u003C= 2 days, plus\n    year-month or quarter for trajectory).\n5.  **What amplifies it (drivers & 2-D interactions):** Bin continuous drivers\n    with within-entity quantiles (`within_quantile_bins` in\n    [references\u002Fmetric_formulas.md](references\u002Fmetric_formulas.md), grouping by\n    `geo_col` or `item_col` when present) so each unit is judged against its own\n    baseline, and cross-tabulate 2-D interactions (e.g., a CATE covariate x\n    treatment intensity, or two covariates from the run).\n6.  **Can we trust it? (Diagnostics & raw segment profiles):** Check repetition\n    stability, OVB sensitivity (`robustness_value` vs. `max(benchmark_cf_d,\n    benchmark_cf_y)` overall and least-robust segments), Phase 0 saturation\n    diagnostics, `low_sample` (`\u003C 30` treated rows), and `plausibility_flags`.\n    Whenever two segments have non-overlapping 95% intervals (`ci_separation` on\n    `roi_on_spend` or `effect_per_unit`) or `plausibility_flags` fire, profile\n    that segment's raw data (`gap_in_row_sd`, `ratio_to_overall`,\n    `treated_share`, and treated `p25\u002Fp50\u002Fp75`) before interpreting.\n7.  **How should allocation move? (Optimization):** When `007_optimization\u002F`\n    exists, report historical vs. optimized spend, incremental KPI, and ROI\n    (total, by `geo_col` \u002F `item_col`, and yearly from\n    `optimization_yearly_summary.csv`), row counts shifted (`increased`,\n    `reduced`, `cut_to_zero`), reconciliation with `optimization_metrics.csv`,\n    and optimizer assumptions\u002Fwarnings. Never design custom allocations, scale\n    to unmodeled budgets, or shift budget across treatments or runs. If absent,\n    note that optimization requires a single-treatment run with `optimize=True`,\n    `date_col`, and spend mapping.\n\n--------------------------------------------------------------------------------\n\n## Causal & Domain Interpretation Rules\n\n-   **Reading 95% intervals:** Always lead with the point estimate and\n    `effect_direction` (`positive`, `negative`, `zero`). Aggregate 95% bands sum\n    row-level bounds conservatively and routinely span zero. **Never** call an\n    estimate \"statistically significant\", \"not significant\", \"inconclusive\", or\n    \"indistinguishable from zero\", and never use the words *significant* or\n    *p-value* in prose (except quoting CATE grades verbatim like `strong\n    (p=0.0022)` as an approximate heterogeneity grade).\n-   **Average vs. Marginal ROI:** `roi_on_spend` is the *average* return on past\n    spend. `worth_investing` justifies **keeping** historical spend;\n    `not_worth_investing` justifies **cutting\u002Fstopping**; `undetermined` calls\n    for a controlled test. Scaling budget *up* requires marginal returns from an\n    active saturation curve or KKT `optimization`. Under saturation, per-unit\n    effect naturally falls at higher spend along diminishing returns.\n-   **Column Role (`cate_covariate` | `confounder` | `unused`) & Constant-Effect\n    Runs:** Per-unit treatment effects vary **only** through\n    `covariates_for_cate_list`. If `covariates_for_cate_list` is empty, per-unit\n    effect is constant by construction and `incremental_kpi` differs across\n    slices only with treatment volume. If a slice column is `confounder` (in\n    `x_cols_list` only, including entity dummies) or `unused`, splitting by it\n    is **descriptive** — showing where effects landed via covariate mix and\n    intensity, not modeled slice-specific response. Say so explicitly and\n    recommend adding the column to `covariates_for_cate_list` to test it. Warn\n    against conditioning on post-treatment variables (columns moved by the\n    treatment itself) as targeting pre-conditions.\n-   **Confounding, Carryover & Spillover:** Inspect `x_cols_list` against the\n    other columns in `consolidated_1a_full_df.csv` to flag unadjusted concurrent\n    treatments or levers, intertemporal pull-forward or lagged carryover\n    effects (`_l\u003Ck>` lagged columns), and cross-unit spillover or substitution\n    across `geo_col` \u002F `item_col`.\n\n--------------------------------------------------------------------------------\n\n## Trust Checklist\n\nCheck | Required Action\n:---- | :--------------\n**Payback & multiplicity** | Keep `worth_investing`, cut `not_worth_investing`, test `undetermined`. Across many `geo_col` or `item_col` slices, ~2.5% per tail can cross `threshold_roi` by chance unless consistent across periods and repetitions.\n**Driver evidence** | Claim a covariate shifts per-unit response only when CATE grade is `strong` (quote verbatim, e.g., `strong (p=0.0022)`). Treat `weak` as a lead to validate and `none` as no modeled heterogeneity.\n**Plausibility & support** | Flag `\u003C 30` treated rows (`low_sample`) as directional only. If `incremental_kpi_exceeds_outcome`, `kpi_without_spend`, or `negative_spend` fires, treat that slice's estimate as unreliable and inspect raw segment profiles.\n**Model & Phase 0** | Caveat high repetition CV (`> 0.3`), mixed repetition signs, `robustness_value \u003C= max(benchmark_cf_d, benchmark_cf_y)` (passing rules out confounders only up to the strongest observed `x_col`), few clusters (`\u003C 30` in `cluster_dml.messages`), or Phase 0 warnings (`1se_fail`, `diag1_fired`, `diag2_fired`, low `r_T`, `fallback_half_saturation_T_used`).\n**Optimizer discipline** | Frame `optimization` strictly as a retrospective model-implied proposal (no carryover\u002Fadstock, point-estimate CATE, no 95% interval). State whether Phase 4 ran `saturation`, `simple`, or `linear_fallback`, warn if `kpi_after > 2.0 * kpi_before` (upper bound from cutting low-scored rows), if `kpi_before \u003C= 0 \u003C kpi_after`, or if `> 30%` of active units are cut to zero, and ask about operational floors\u002Fcontracts.\n\n--------------------------------------------------------------------------------\n\n## Mandatory Statement Tagging (`Fact:` \u002F `Inference:` \u002F `Hypothesis:`)\n\nStart **every bullet point** (and every standalone result sentence) with\n**exactly one** bold tag — never rely on section headers, and split mixed\nbullets:\n\n-   **Fact:** Raw input panel quantities (`spend`, observed KPI, row\u002Ftreated\n    counts, treatment intensity quantiles, bin cut points, covariate means).\n-   **Inference:** DML model outputs (`incremental_kpi`, 95% intervals,\n    `roi_on_spend`, payback verdicts, CATE evidence grades, sensitivity `RV`,\n    model-implied optimization numbers).\n-   **Hypothesis:** Proposed mechanism explaining *why* an inference occurred,\n    always paired with a concrete verification step (config change or holdout\n    experiment).\n\n## Bundled References\n\n-   Exact aggregation, ROI, CATE grading, diagnostics, and optimization\n    formulas: [references\u002Fmetric_formulas.md](references\u002Fmetric_formulas.md)\n-   Full causal review structure and statement-tagging examples:\n    [references\u002Freport_template.md](references\u002Freport_template.md)\n",{"name":5,"description":7},"main","4a2fa881650c17152c7ab1872c22f89c5999ddc2","skills\u002Fcausal-insights",12,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fdoubleml-pipeline","https:\u002F\u002Fpypi.org\u002Fproject\u002Fdoubleml-pipeline\u002F","https:\u002F\u002Fgithub.com\u002Fgoogle","https:\u002F\u002Fopensource.google\u002F","Google ❤️ Open Source","2026-11-12 15:38:34",{"source":9,"skillName":5,"commands":67,"prompt":77,"zipAvailable":78},[68,71,74],{"tool":69,"command":70},"npx","npx skills add google\u002Fdoubleml-pipeline --skill causal-insights",{"tool":72,"command":73},"bunx","bunx skills add google\u002Fdoubleml-pipeline --skill causal-insights",{"tool":75,"command":76},"pnpm","pnpm dlx skills add google\u002Fdoubleml-pipeline --skill causal-insights","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fdoubleml-pipeline\u002Fblob\u002Fmain\u002Fskills\u002Fcausal-insights\u002FSKILL.md",true,[80,86],{"path":81,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":84,"sourceHtmlUrl":85},"references\u002Fmetric_formulas.md","REFERENCE","参考文档",9671,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fdoubleml-pipeline\u002Fblob\u002Fmain\u002Fskills\u002Fcausal-insights\u002Freferences\u002Fmetric_formulas.md",{"path":87,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":88,"sourceHtmlUrl":89},"references\u002Freport_template.md",7342,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fdoubleml-pipeline\u002Fblob\u002Fmain\u002Fskills\u002Fcausal-insights\u002Freferences\u002Freport_template.md",[]]