SCM-合成控制法(Synthetic Control)
合成控制法(Synthetic Control Method, SCM)用于评估单一(或少量)处理单元在某一干预时点后的因果效应。核心思想是:在处理前阶段,通过对对照组单位赋予非负且和为 1 的权重,构造一个“合成处理组”,使其在处理前尽量贴近真实处理组;处理后两者差异即视为干…
SCM-合成控制法(Synthetic Control)
1. 方法概述
合成控制法(Synthetic Control Method, SCM)用于评估单一(或少量)处理单元在某一干预时点后的因果效应。核心思想是:在处理前阶段,通过对对照组单位赋予非负且和为 1 的权重,构造一个“合成处理组”,使其在处理前尽量贴近真实处理组;处理后两者差异即视为干预效应。
设面板数据包含单位集合 \(\mathcal{U}=\{1,2,\ldots,J+1\}\),其中单位 \(1\) 为处理组,单位 \(2,\ldots,J+1\) 为候选对照组(donor pool);时间集合为 \(t=1,2,\ldots,T\)。
观测结果变量记为
$$ Y_{it},\quad i\in\mathcal{U},\ t=1,\ldots,T \tag{1} $$
干预时点记为 \(T_0\)。本系统约定:
$$ \text{pre}:\ t<T_0,\qquad \text{post}:\ t\ge T_0 \tag{2} $$
2. 潜在结果与目标效应
记处理组在时点 \(t\) 的潜在结果为 \(Y_{1t}^I\)(受干预)与 \(Y_{1t}^N\)(未受干预)。观测结果满足
$$ Y_{1t}=Y_{1t}^N+\alpha_{1t}D_t \tag{3} $$
其中 \(D_t=\mathbf{1}(t\ge T_0)\),\(\alpha_{1t}\) 为干预效应。SCM 的核心是估计反事实 \(Y_{1t}^N\),并据此得到
$$ \hat\alpha_{1t}=Y_{1t}-\hat Y_{1t}^N,\qquad t\ge T_0 \tag{4} $$
3. 合成对照构造
设 donor 权重向量
$$ W=(w_2,\ldots,w_{J+1})^\top \tag{5} $$
满足单纯形约束
$$ w_j\ge 0,\quad \sum_{j=2}^{J+1}w_j=1 \tag{6} $$
则处理组的反事实由加权对照组给出:
$$ \hat Y_{1t}^N=\sum_{j=2}^{J+1}w_jY_{jt} \tag{7} $$
4. 匹配变量与优化问题
SCM 通常在处理前匹配变量上最小化距离。记处理组匹配向量为 \(X_1\),donor 匹配矩阵为 \(X_0\),则优化问题为
$$ \min_W\ (X_1-X_0W)^\top V (X_1-X_0W) \tag{8} $$
其中 \(V\) 为匹配变量权重矩阵(常取对角矩阵)。
本系统实现中,支持在目标函数中加入 ridge 正则(可选):
$$ \min_W\ \|X_1-X_0W\|_2^2+\lambda\|W\|_2^2 \tag{9} $$
并同时满足式(6)的约束。
4.1 匹配变量模式(与系统一致)
系统支持三种 predictors 模式:
pre_outcomes:使用处理前结果序列作为匹配变量;custom:使用用户选择的协变量在 pre 期的统计量(默认均值);both:同时使用 1) 与 2)。
对应地,\(X_1\) 与 \(X_0\) 由上述变量拼接而成。
5. 处理效应与汇总指标
点态效应(gap)定义为
$$ \text{gap}_t=Y_{1t}-\hat Y_{1t}^N \tag{10} $$
处理后平均效应(ATT)可写为
$$ \widehat{ATT}=\frac{1}{T-T_0+1}\sum_{t=T_0}^{T}\text{gap}_t \tag{11} $$
处理后累计效应为
$$ \widehat{CUM}=\sum_{t=T_0}^{T}\text{gap}_t \tag{12} $$
6. 拟合质量与诊断指标
6.1 预处理/后处理 RMSPE
$$ \text{RMSPE}_{\text{pre}}=\sqrt{\frac{1}{T_0-1}\sum_{t=1}^{T_0-1}(Y_{1t}-\hat Y_{1t}^N)^2} \tag{13} $$
$$ \text{RMSPE}_{\text{post}}=\sqrt{\frac{1}{T-T_0+1}\sum_{t=T_0}^{T}(Y_{1t}-\hat Y_{1t}^N)^2} \tag{14} $$
RMSPE 比值:
$$ R=\frac{\text{RMSPE}_{\text{post}}}{\text{RMSPE}_{\text{pre}}} \tag{15} $$
6.2 其他误差指标
$$ \text{MAE}=\frac{1}{T}\sum_{t=1}^{T}|Y_{1t}-\hat Y_{1t}^N| \tag{16} $$
$$ \text{RMSE}=\sqrt{\frac{1}{T}\sum_{t=1}^{T}(Y_{1t}-\hat Y_{1t}^N)^2} \tag{17} $$
$$ \text{Bias}=\frac{1}{T}\sum_{t=1}^{T}(Y_{1t}-\hat Y_{1t}^N) \tag{18} $$
当 \(Y_{1t}\neq 0\) 时,平均绝对百分比误差为
$$ \text{MAPE}=\frac{1}{T}\sum_{t=1}^{T}\left|\frac{Y_{1t}-\hat Y_{1t}^N}{Y_{1t}}\right| \tag{19} $$
7. Placebo(置换)检验
为检验效应显著性,可将每个 donor 单位依次“假设为处理组”,重复 SCM,得到其 RMSPE 比值 \(R_j\)。
经验 p 值可定义为
$$ \hat p=\frac{1+\sum_{j=2}^{J+1}\mathbf{1}(R_j\ge R_1)}{J} \tag{20} $$
其中 \(R_1\) 为真实处理组 RMSPE 比值。
若 \(\hat p\) 较小,说明真实处理组在 post 期偏离程度显著高于 placebo 单位,支持存在干预效应。
8. 权重集中度与可解释性
为衡量合成对照是否由少数 donor 主导,可计算 Herfindahl 指数:
$$ \text{HHI}=\sum_{j=2}^{J+1} w_j^2 \tag{21} $$
有效 donor 数可近似为
$$ N_{\text{eff}}=\frac{1}{\sum_{j=2}^{J+1}w_j^2} \tag{22} $$
9. 与系统实现对应的标准流程
- 读取面板数据并设置
unit/time/outcome; - 指定
treated_unit与intervention_time; - 构造 predictors(
pre_outcomes/custom/both); - 在约束 \(w\ge0,\sum w=1\) 下求解式(9);
- 计算
treated/synthetic/gap与式(11)–(19)指标; - 可选执行 placebo 检验(式(20));
- 导出 Excel 多表与图表(treated_vs_synth、gap、weights、predictor_balance、rmspe、placebo)。
10. 符号说明表
| 符号 | 含义 |
|---|---|
| \(Y_{it}\) | 单位 \(i\) 在时点 \(t\) 的结果变量 |
| \(T_0\) | 干预时点 |
| \(W\) | donor 权重向量 |
| \(X_1, X_0\) | 处理组与 donor 的匹配变量表示 |
| \(V\) | 匹配变量权重矩阵 |
| \(\lambda\) | ridge 正则参数 |
| \(\text{gap}_t\) | 时点效应(treated-synthetic) |
| \(\widehat{ATT}\) | 处理后平均效应 |
| \(R\) | RMSPE 比值 |
| \(\hat p\) | placebo 经验 p 值 |
11. 论文写作模板
11.1 中文方法段落模板
“本文采用合成控制法(SCM)评估政策冲击对处理单元结果变量的影响。以处理前样本为匹配窗口,在 donor pool 上求解非负且和为 1 的权重(式(6)),使处理组与合成对照在匹配变量上距离最小(式(8)或式(9))。处理后效应由处理组与合成对照差值给出(式(10)),并报告平均效应与累计效应(式(11)–(12))。此外,采用 placebo 检验构造经验 p 值(式(20))以评估结果显著性。”
11.2 中文图表题注模板
- 图 1 处理组与合成对照在全时期的轨迹对比图(treated vs synthetic)。
- 图 2 处理效应时间路径图(gap 随时间变化)。
- 图 3 donor 权重分布图(weights)。
- 图 4 placebo gaps 与 RMSPE 比值对比图。
11.3 英文摘要段落模板
“We evaluate the causal effect of an intervention using the Synthetic Control Method (SCM). A convex combination of donor units is constructed by solving non-negative weights summing to one, such that the treated unit is closely matched in the pre-intervention period. The post-intervention effect is measured by the gap between the treated and synthetic outcomes over time, and summarized by average and cumulative treatment effects. We further conduct placebo tests and report empirical p-values based on post/pre RMSPE ratios to assess statistical significance and robustness.”
12. 实现说明与注意事项
- pre 期至少应有 2 个时间点,post 期至少 1 个时间点;
- donor pool 建议不少于 2 个单位;
- 若权重高度集中(HHI 过高),需警惕由单一 donor 驱动;
- placebo 的可比性依赖于 donor 与 treated 在 pre 期的可匹配程度;
- 结果解释应结合政策背景与并行证据,不宜仅依赖单一统计量。
附录 A:英文图表题注模板与英文表注模板
A.1 英文图题模板
-
Fig. 1. Treated vs. synthetic outcome trajectories.
Notes: The vertical dashed line marks the intervention time \(T_0\). The pre-intervention fit indicates how closely the synthetic control reproduces the treated unit before treatment. -
Fig. 2. Time-varying treatment effect (gap) plot.
Notes: The gap is defined as \(Y_{1t}-\hat Y_{1t}^N\) (Eq. (10)). Positive values indicate that the treated outcome is above its synthetic counterfactual. -
Fig. 3. Donor weight distribution in the synthetic control.
Notes: Weights are constrained to be non-negative and sum to one (Eq. (6)). Larger bars indicate stronger contribution from corresponding donor units. -
Fig. 4. Placebo gap paths across donor units.
Notes: Each thin line represents a placebo unit treated at the same intervention date. The highlighted line corresponds to the actual treated unit. -
Fig. 5. Post/pre RMSPE ratio comparison (treated vs. placebos).
Notes: Ratios are computed as in Eq. (15). A relatively large treated-unit ratio suggests stronger post-intervention divergence.
A.2 英文表格标题模板
-
Table 1. Baseline SCM specification and sample definition.
Notes: This table reports the treated unit, donor pool, intervention time, predictor set, and estimation settings. -
Table 2. Synthetic control weights and cumulative contributions.
Notes: Columns include donor unit, estimated weight, percentage share, and cumulative weight. -
Table 3. Pre-treatment fit and post-treatment effect summary.
Notes: Report RMSPE\(_{pre}\), RMSPE\(_{post}\), RMSPE ratio, ATT, and cumulative effect based on Eqs. (11)–(15). -
Table 4. Predictor balance between treated and synthetic units.
Notes: Present treated values, synthetic values, raw gaps, and absolute gaps for each predictor. -
Table 5. Placebo test results and empirical significance.
Notes: Report placebo-unit RMSPE ratios and the empirical p-value defined in Eq. (20).
A.3 英文通用表注模板(可选)
- General note for figures: “The intervention date is indicated by a vertical dashed line. Pre-intervention periods are used for model fitting, while post-intervention periods are used for effect evaluation.”
- General note for tables: “All estimates are obtained from the constrained SCM optimization with non-negative donor weights summing to one. Standard errors are not shown because inference is based on placebo distributions.”
13. 单篇终审补充
13.1 图题与表题对齐建议
- 本文档应优先对应真实算法目录
具体的算法2/SCM-合成控制法(Synthetic Control)。 - 代表性结果目录建议绑定
具体的算法2/SCM-合成控制法(Synthetic Control)/results/SCM-合成控制法分析结果_20260228_041955,因为该目录同时具备xlsx + 图 + repro。 - 表题应直接对应
SCM-合成控制法分析结果_20260228_041955.xlsx的真实工作表:Parameters、Estimation、Weights、Diagnostics、Forecast、PredictorBalance、PlaceboSummary、PlaceboGaps、Charts。 - 图题应优先绑定该目录下真实图:
treated_vs_synth_20260228_041956.png、gap_20260228_041956.png、weights_20260228_041956.png、predictor_balance_20260228_041956.png、placebo_gaps_20260228_041956.png、placebo_ratio_20260228_041956.png、rmspe_20260228_041956.png。
13.2 终审说明
- 当前 SCM 目录内同时保留正式分析结果
SCM-合成控制法分析结果_20260228_041955.xlsx和复现产物SCM复现结果_20260228_042121.xlsx,属于同轮相邻时间戳导出。 - 复现脚本实际为
repro_scm_template_20260228_041955.py,而较新的根目录脚本repro_scm_template_20260329_165325.py的SRC_FILE写法为scm_window1_input.csv,属于“results根目录脚本同目录 CSV 快照复现”口径。 - 因此论文若写复现链路,应明确“正式示例结果目录”和“后续根目录复现脚本”并存,不要误写成固定
repro_inputs结构。
13.3 全量强化补充
- 当前 SCM 文档应绑定真实算法目录
具体的算法2/SCM-合成控制法(Synthetic Control),代表性主结果目录为具体的算法2/SCM-合成控制法(Synthetic Control)/results/SCM-合成控制法分析结果_20260228_041955。 - 该目录当前同时保留两份工作簿:主结果
SCM-合成控制法分析结果_20260228_041955.xlsx和复现结果SCM复现结果_20260228_042121.xlsx。两者的真实工作表一致,均为Parameters、Estimation、Weights、Diagnostics、Forecast、PredictorBalance、PlaceboSummary、PlaceboGaps、Charts。 - 当前主目录中的图文件也成对保留:
treated_vs_synth_20260228_041956.png、gap_20260228_041956.png、weights_20260228_041956.png、predictor_balance_20260228_041956.png、placebo_gaps_20260228_041956.png、placebo_ratio_20260228_041956.png、rmspe_20260228_041956.png对应主运行;而同组20260228_042121后缀图片对应复现再生产物。 - 当前目录中的复现脚本
repro_scm_template_20260228_041955.py关键输入写法为SRC_FILE = 'uploads/sample_data.csv'。这说明旧版主目录 repro 口径不是repro_inputs,而是相对脚本位置回指uploads/sample_data.csv。 - 同时,
results根目录下较新的脚本repro_scm_template_20260329_165325.py又采用了SRC_FILE = 'scm_window1_input.csv'的脚本同目录 CSV 快照口径。也就是说,SCM 当前实际存在两种历史复现路径:旧结果目录回指uploads,新根目录脚本读取同目录 CSV。 - 因此 SCM 文档不能被简化成“标准
repro_inputs结构”。更准确的写法是:正式示例目录内保留旧版uploads回指脚本和复现再生产物,而后续较新根目录脚本采用results根目录平铺 CSV 的快照复现方式。 - 论文与附录若需要强调可复现性,应优先把主结果簿、主运行图、
SCM复现结果_20260228_042121.xlsx和repro_scm_template_20260228_041955.py作为一组历史完整证据,并单独备注 20260329 根目录脚本属于后续新链路,不要混成单一固定模板。
14. 软件实现核查补充(2026-07)
- 当前实现的主结果目录应写作
具体的算法2/SCM-合成控制法(Synthetic Control)/results/SCM-合成控制法分析结果_20260228_041955,主工作簿和复现工作簿都在同一目录中。 - 正文应围绕
Parameters、Estimation、Weights、Diagnostics、Forecast、PredictorBalance、PlaceboSummary、PlaceboGaps、Charts来写,图则对应主轮treated_vs_synth_20260228_041956.png、gap_20260228_041956.png、weights_20260228_041956.png、predictor_balance_20260228_041956.png、placebo_gaps_20260228_041956.png、placebo_ratio_20260228_041956.png、rmspe_20260228_041956.png。 - 旧版
uploads/sample_data.csv回指脚本和后续根目录scm_window1_input.csv脚本属于两种历史复现路径,正文要分开写。 - 如果论文只需一条最稳妥证据链,就优先引用主结果簿、主轮图和
repro_scm_template_20260228_041955.py。