基本概念和定义

一个简单的例子,患者在头痛后选择了吃阿司匹林,并最后缓解头痛。我们在意的就是这一结果是否能解释为阿司匹林的药效。

单元 (Unit)

  • 通常是一个物理实体或者实体的集合,比如每个人、每个班级等
  • 不同时间下的同一实体认为是不同的单元

动作 (Action)

  • 对于每个单元所采取的操作
  • 比如吃阿司匹林、不吃阿司匹林或者吃另一种止疼药

因果性 (Causality)

  • 因果性和对一个单元施加的动作直接相关
  • 通常我们考虑两个动作(实验组 (treatment) 和对照组 (control)),但直接推广到多动作也是平凡的

潜在结果 (Potential outcome)

  • 每个动作-单元对都会产生一组潜在结果,如 \(Y_c,Y_t\)
  • 每次实验中,只能得到一个潜在结果即观测结果 \(Y^\mathrm{obs}\),另一个将无法观测到 \(Y^\mathrm{mis}\)
  • 某一动作相对于另一动作的因果效应就是潜在结果的对比,如 \(Y_t-Y_c\)\(Y_t/Y_c\)

因果推断的难点

至此可以看到,因果推断最核心的难题就是, \(Y_t,Y_c\) 仅有可能观测到一个,因此没法直接得到因果的效应。在只有一个单元的情况下显然是不可做的,而在有多个单元的情况下其实也不容易做

  • 如果是同一时间的不同实体,比如选择 100 名头痛患者并分组处理。但可能有下列问题
    • 甲不吃药后头痛的严重程度和乙如果不吃药后的结果其实不一样
    • 不同人的初始头痛的严重程度不一样
    • 不同人对阿司匹林的敏感度不同
  • 如果是同一实体的不同时间,比如让一个人在几次头痛中有几次吃药几次不吃药。但可能也有下列的问题
    • 不同时间的同一实体本质上还是不同的单元
    • 比如患者可能会产生耐药性
    • 比如晚上和白天效果不一样是

所以我们只能进行一定的假设。在阿司匹林的例子中就是:甲是否吃药不会影响乙的头痛的状态(无论乙吃药或否)。这一点看起来通常是对的,但也不能排除其错误的可能——比如甲乙同在一个屋子里,除非甲吃药并缓解头痛,否则他无止尽的抱怨会加重乙的头痛严重程度。但这一点通常还是可以通过实验来减少这一干扰的。

SUTVA

将该思想抽象出来,我们就得到了一个极其重要的假设 Stable Unit Treatment Value Assumptioni (SUTVA)。其核心为两点

  • 没有交叉影响:任何单元的潜在结果不会受其他单元的(实验组/对照组)分配情况的影响
  • 处理组没有隐含的差别:对每个单元,其处理组处理的方式只有一种,也就是说处理组的潜在结果只有一种。以阿司匹林为例,就意味着处理组不存在单个个体因为阿司匹林摄入量的不同而产生不同的结果

在这样的假设下,模型得到了进一步的简化,此时我们通常记

\[Y _ { i } ^ { \mathrm { obs } } = Y _ { i } \left( W _ { i } \right) = \left\{ \begin{array} { l l } { Y _ { i } ( 0 ) } & { \text { if } W _ { i } = 0 } \\ { Y _ { i } ( 1 ) } & { \text { if } W _ { i } = 1 } \end{array} \right.\]

\[Y _ { i } ^ { \mathrm { mis } } = Y _ { i } \left( 1 - W _ { i } \right) = \left\{ \begin{array} { l l } { Y _ { i } ( 1 ) } & { \text { if } W _ { i } = 0 } \\ { Y _ { i } ( 0 ) } & { \text { if } W _ { i } = 1 } \end{array} \right.\]

协变量

由于至少一半的潜在结果无法被观测到,我们通常需要预估或者说填充这些缺失值来进行我们的因果推断。因此,如果有一些实验前就观测到的协变量,将会对我们的预测有很大帮助。同时,这些变量在我们决定分组的时候也可能产生很大的作用——比如说,我们想测试阿司匹林对减轻头痛的因果效应时,可能就不会接受实验组全部为男性,对照组全部为女性的分组方式,因为这将使我们没法断定实验的结果是解释为阿司匹林还是解释为性别差异。

分配机制 (Assignment Mechanism)

定义

给定 \(N\) 个单元后,分配机制是一个行可交换的函数 ,取值 \([0,1]\) 且满足

\[\sum\limits_ { \mathbf { W } \in \{ 0,1 \} ^ { N } } \mathbb{P} ( \mathbf { W } | \mathbf { X } , \mathbf { Y } ( 0 ) , \mathbf { Y } ( 1 ) ) = 1 , \text { for all } \mathbf { X } , \mathbf { Y } ( 0 ) , \text { and } \mathbf { Y } ( 1 )\]

也就是说给定了协变量和潜在结果后,分配机制给出了所有分配向量的概率;而每个分配向量决定了哪些单元接受处理——也就是哪些潜在结果被观测到,而哪些无法被观测。

在此基础上,我们考察个体接受处理的概率,定义为

\[p _ { i } ( \mathbf { X } , \mathbf { Y } ( 0 ) , \mathbf { Y } ( 1 ) ) = \sum _ { \mathbf { W } : W _ { i } = 1 } \operatorname { Pr } ( \mathbf { W } | \mathbf { X } , \mathbf { Y } ( 0 ) , \mathbf { Y } ( 1 ) )\]

我们也可以考察某一类单元接受处理的概率,我们称之为倾向得分 (Propensity score),定义为

\[e ( x ) = \frac { 1 } { N ( x ) } \sum\limits _ { i : X _ { i } = x } p _ { i } ( \mathbf { X } , \mathbf { Y } ( 0 ) , \mathbf { Y } ( 1 ) )\]

其中 \(N(x)=\mathrm{Card}(\{i=1,\ldots,N\mid X_i=x\})\)\(X_i=x\) 集合元素的个数

例子一

两个样本,\(2^2=4\) 个分配向量:

\[\mathbf { W } \in \left\{ \left( \begin{array} { l } { 0 } \\ { 0 } \end{array} \right) , \left( \begin{array} { l } { 0 } \\ { 1 } \end{array} \right) , \left( \begin{array} { l } { 1 } \\ { 0 } \end{array} \right) , \left( \begin{array} { l } { 1 } \\ { 1 } \end{array} \right) \right\}\]

分配机制为完全随机分配,即

\[\mathbb{P} ( \mathbf { W } | \mathbf { X } , \mathbf { Y } ( 0 ) , \mathbf { Y } ( 1 ) ) = 1 / 4 , \quad \text { for } \mathbf { W } \in \left\{ \left( \begin{array} { l } { 0 } \\ { 0 } \end{array} \right) , \left( \begin{array} { l } { 0 } \\ { 1 } \end{array} \right) , \left( \begin{array} { l } { 1 } \\ { 0 } \end{array} \right) , \left( \begin{array} { l } { 1 } \\ { 1 } \end{array} \right) \right\}\]

个体接受处理概率为

\[p _ { i } ( \mathbf { X } , \mathbf { Y } ( 0 ) , \mathbf { Y } ( 1 ) ) = 1 / 2 \text { for both units } i = 1,2\]

倾向性得分为

由于没有协变量参与分配机制,因此对任何协变量的取值 \(x\) 都有 \(e(x)=1/2\)

例子二

两个样本,\(2^2=4\) 个分配向量:

\[\mathbf { W } \in \left\{ \left( \begin{array} { l } { 0 } \\ { 0 } \end{array} \right) , \left( \begin{array} { l } { 0 } \\ { 1 } \end{array} \right) , \left( \begin{array} { l } { 1 } \\ { 0 } \end{array} \right) , \left( \begin{array} { l } { 1 } \\ { 1 } \end{array} \right) \right\}\]

分配机制为只考虑两个样本分配到不同组的情形,即

\[\operatorname { Pr } ( \mathbf { W } | \mathbf { X } , \mathbf { Y } ( 0 ) , \mathbf { Y } ( 1 ) ) = \left\{ \begin{array} { l l } { 1 / 2 } & { \text { if } \mathbf { W } \in \left\{ \left( \begin{array} { l } { 0 } \\ { 1 } \end{array} \right) , \left( \begin{array} { l } { 1 } \\ { 0 } \end{array} \right) \right\} } \\ { 0 } & { \text { if } \mathbf { W } \in \left\{ \left( \begin{array} { l } { 0 } \\ { 0 } \end{array} \right) , \left( \begin{array} { l } { 1 } \\ { 1 } \end{array} \right) \right\} } \end{array} \right.\]

个体接受处理概率为

\[p _ { i } ( \mathbf { X } , \mathbf { Y } ( 0 ) , \mathbf { Y } ( 1 ) ) = 1 / 2 \text { for both units } i = 1,2\]

倾向性得分为

由于没有协变量参与分配机制,因此对任何协变量的取值 \(x\) 都有 \(e(x)=1/2\)

例子三

两个样本,\(2^2=4\) 个分配向量:

\[\mathbf { W } \in \left\{ \left( \begin{array} { l } { 0 } \\ { 0 } \end{array} \right) , \left( \begin{array} { l } { 0 } \\ { 1 } \end{array} \right) , \left( \begin{array} { l } { 1 } \\ { 0 } \end{array} \right) , \left( \begin{array} { l } { 1 } \\ { 1 } \end{array} \right) \right\}\]

分配机制为:将 \(Y(1)-Y(0)\) 大的分配给实验组,另一个为对照组。如果相等则随机分配,即

\[\operatorname { Pr } ( \mathbf { W } | \mathbf { X } , \mathbf { Y } ( 0 ) , \mathbf { Y } ( 1 ) ) = \left\{ \begin{array} { l l } \begin{array} { l } { 1 } & { \text { if } Y _ { 2 } ( 1 ) - Y _ { 2 } ( 0 ) > Y _ { 1 } ( 1 ) - Y _ { 1 } ( 0 ) \text { and } \mathbf { W } = \left( \begin{array} { l } { 0 } \\ { 1 } \end{array} \right) } \\ { 1 } & { \text { if } Y _ { 2 } ( 1 ) - Y _ { 2 } ( 0 ) < Y _ { 1 } ( 0 ) \text { and } \mathbf { W } = \left( \begin{array} { l } { 1 } \\ { 0 } \end{array} \right) } \\ { 1 / 2 } & { \text { if } Y _ { 2 } ( 1 ) - Y _ { 2 } ( 0 ) = Y _ { 1 } ( 1 ) - Y _ { 1 } ( 0 ) \text { and } \mathbf { W } \in \left\{ \left( \begin{array} { c } { 0 } \\ { 1 } \end{array} \right) , \left( \begin{array} { c } { 1 } \\ { 0 } \end{array} \right) \right\} } \\ {0} & {\text { if } \mathbf { W } \in \left\{ \left( \begin{array} { l } { 0 } \\ { 0 } \end{array} \right) , \left( \begin{array} { l } { 1 } \\ { 1 } \end{array} \right) \right\}} \\ { 0 } & {\text { if } Y _ { 2 } ( 1 ) - Y _ { 2 } ( 0 ) < Y _ { 1 } ( 1 ) - Y _ { 1 } ( 0 ) \text { and } \mathbf { W } = \left( \begin{array} { c } { 0 } \\ { 1 } \end{array} \right) } \\ { 0 } & { \text { if } Y _ { 2 } ( 1 ) - Y _ { 2 } ( 0 ) > Y _ { 1 } ( 1 ) - Y _ { 1 } ( 0 ) \text { and } \mathbf { W } = \left( \begin{array} { c } { 1 } \\ { 0 } \end{array} \right) } \end{array} \end{array} \right.\]

个体接受处理概率为

\[p _ { i } ( \mathbf { X } , \mathbf { Y } ( 0 ) , \mathbf { Y } ( 1 ) ) =0,\ 1 / 2 \text { or } 1\]

倾向性得分为

由于没有协变量参与分配机制,因此对任何协变量的取值 \(x\) 都有 \(e(x)=1/2\)

例子四

三个样本,协变量 \(X_i=i\)\(2^3=8\) 个分配向量:

\[\mathbf { W } \in \left\{ \left( \begin{array} { l }{ 0 } \\ { 0 } \\ { 0 } \end{array} \right) , \left( \begin{array} { l } { 0 } \\{ 0 } \\ { 1 } \end{array} \right) , \left( \begin{array} { l } { 0 } \\{ 1 } \\ { 0 } \end{array} \right) , \left( \begin{array} { l } { 0 } \\{ 1 } \\ { 1 } \end{array} \right),\left( \begin{array} { l } { 1 } \\ { 0 } \\ { 0 } \end{array} \right) , \left( \begin{array} { l }{ 1 } \\ { 0 } \\ { 1 } \end{array} \right) , \left( \begin{array} { l }{ 1 } \\ { 1 } \\ { 0 } \end{array} \right) , \left( \begin{array} { l } { 1 } \\ { 1 } \\ { 1 } \end{array} \right) \right\}\]

分配机制为:将 \(Y(1)-Y(0)\) 大的分配给实验组,另一个为对照组。如果相等则随机分配,即

\[\operatorname { Pr } ( \mathbf { W } | \mathbf { X } , \mathbf { Y } ( 0 ) , \mathbf { Y } ( 1 ) ) = \left\{ \begin{array} { l l } {1 / 2} & { \text { if } Y _ { 1 } ( 0 ) > Y _ { 2 } ( 1 ) , \text { and } \mathbf { W } = \left( \begin{array} { l } { 0 } \\ { 1 } \\ { 0 } \end{array} \right) } \\{1 / 2} & { \text { if } Y _ { 1 } ( 1 ) \ge Y _ { 2 } ( 0 ) , \text { and } \mathbf { W } = \left( \begin{array} { l } { 1 } \\ { 0 } \\ { 1 } \end{array} \right) } \\{1 / 2} & { \text { if } Y _ { 1 } ( 0 ) \le Y _ { 2 } ( 1 ) , \text { and } \mathbf { W } = \left( \begin{array} { l } { 0 } \\ { 1 } \\ { 1 } \end{array} \right) } \\{1 / 2} & { \text { if } Y _ { 1 } ( 1 ) < Y _ { 2 } ( 0 ) , \text { and } \mathbf { W } = \left( \begin{array} { l } { 1 } \\ { 0 } \\ { 0 } \end{array} \right) } \\\end{array} \right.\]

个体接受处理概率为

\[p _ { 1 } ( \mathbf { X } , \mathbf { Y } ( 0 ) , \mathbf { Y } ( 1 ) ) =p _ { 2 } ( \mathbf { X } , \mathbf { Y } ( 0 ) , \mathbf { Y } ( 1 ) ) =1/2\]

\[p _ { 3 } ( \mathbf { X } , \mathbf { Y } ( 0 ) , \mathbf { Y } ( 1 ) ) = \left\{ \begin{array} { l l } { 0 } & { \text { if } Y _ { 1 } ( 0 ) > Y _ { 2 } ( 1 ) \text { and } Y _ { 1 } ( 1 ) < Y _ { 2 } ( 0 ) } \\ { 1 } & { \text { if } Y _ { 1 } ( 1 ) \geq Y _ { 2 } ( 0 ) \text { and } Y _ { 1 } ( 0 ) \leq Y _ { 2 } ( 1 ) } \\ { 1 / 2 } & { \text { otherwise } } \end{array} \right.\]

倾向得分为

\[e(X_i=1)=e(X_i=2)=1/2, e(X_i=3)=p_3(\mathbf{X},\mathbf{Y}(0),\mathbf{Y}(1))\]

更严格的分配机制

独立分配 (Individualistic assignment)

要求每个个体的分配概率独立于其他个体,即

\[p _ { i } ( \mathbf { X } , \mathbf { Y } ( 0 ) , \mathbf { Y } ( 1 ) ) = q \left( X _ { i } , Y _ { i } ( 0 ) , Y _ { i } ( 1 ) \right) , \text { for all } i = 1 , \ldots , N\]

那么此时

\[\mathbb{P} ( \mathbf { W } | \mathbf { X } , \mathbf { Y } ( 0 ) , \mathbf { Y } ( 1 ) ) = c \cdot \prod _ { i = 1 } ^ { N } q \left( X _ { i } , Y _ { i } ( 0 ) , Y _ { i } ( 1 ) \right) ^ { W _ { i } } \left( 1 - q \left( X _ { i } , Y _ { i } ( 0 ) , Y _ { i } ( 1 ) \right) \right) ^ { 1 - W _ { i } }\]

\[e ( x ) = \frac { 1 } { N ( x ) } \sum\limits _ { i : X _ { i } = x } q ( X_i , Y_i ( 0 ) , Y_i ( 1 ) )\]

上面四个例子中,第四个例子不满足这一条件

概率型分配 (Probabilistic assignment)

要求对每个个体的每个动作的分配,都要有非零的概率。在只有两个动作的情况下,则意味着分配至控制组的概率满足 \(0<p<1\)

无混杂分配 (Unconfounded assignment)

要求分配机制和潜在结果是独立的,即

\[\mathbb{P} ( \mathbf { W } | \mathbf { X } , \mathbf { Y } ( 0 ) , \mathbf { Y } ( 1 ) ) =\mathbb{P} ( \mathbf { W } | \mathbf { X } )\]

之前的例子中一和二是无混杂的,三和四都是有混杂的

三者的综合: 规范分配 (Regular assignment)

此时可以得到

\[\mathbb{P} ( \mathbf { W } | \mathbf { X } , \mathbf { Y } ( 0 ) , \mathbf { Y } ( 1 ) ) = c \cdot \prod _ { i = 1 } q \left( X _ { i } \right) ^ { W _ { i } } \cdot \left( 1 - q \left( X _ { i } \right) \right) ^ { 1 - W _ { i } }\]

\[e(x)=q(x)\]

也就是说分配机制就是倾向得分的乘积,而此时倾向得分又可以解释为 \(X_i=x\) 的个体分配的概率(之前是这些个体分配的概率的均值)

有哪些非规范的情况呢?

  • 非依从性:某些个体实际接受的处理可能和设计不一样——比如实验组可能不愿意吃实验性的药物而偷偷拒绝服药

随机化实验 (Randomized experiments)

随机化实验指的是分配机制

  • 是概率型分配,即带有一定的随机性
  • 有研究者可以控制的函数形式,也就是这是一个实验 (Experiment)

经典随机化实验 (Classical Randomized Experiments) 则还要求

  • 独立分配
  • 无混杂分配

经典随机化实验中又会有三个特殊的情形,我们将在接下来的五节中涉及相关的推断,他们是

  • 完全随机化实验 (Completely randomized experiments)
  • 分层随机化实验 (Stratified randomized experiments)
  • 配对随机试验 (Paired randomized experiments)

经典随机化实验的例子

伯努利试验

对于 \(N\) 个样本,投掷 \(N\) 次正面向上概率为 \(p=e(X_i)\) 的硬币,并以正面代表实验组处理而反面代表控制组处理。即

\[\mathbb{P} ( \mathbf { W } | \mathbf { X } , \mathbf { Y } ( 0 ) , \mathbf { Y } ( 1 ) ) = \prod _ { i = 1 } ^ { N } \left[ e \left( X _ { i } \right) ^ { W _ { i } } \cdot \left( 1 - e \left( X _ { i } \right) \right) ^ { 1 - W _ { i } } \right]\]

此时分配向量的支撑集,即使得上式非零的集合为 \(\mathbb{W}^+=\mathbb{W}=\{0,1\}^N\)

完全随机化实验

相比伯努利实验,其要求有 \(N_t\) 个接受实验组而 \(N_c=N-N_t\) 个接受控制组,且每个样本被分配的概率都是 \(q=N_c/N\),即

\[\mathbb{P} ( \mathbf { W } | \mathbf { X } , \mathbf { Y } ( 0 ) , \mathbf { Y } ( 1 ) ) = \left\{ \begin{array} { l l } { \left( \begin{array} { c } { N } \\ { N _ { t } } \end{array} \right)^{-1} } & { \text { if } \sum _ { i = 1 } ^ { N } W _ { i } = N _ { t } } \\ { 0 } & { \text { otherwise } } \end{array} \right.\]

此时的支撑集为 \[\mathbb { W } ^ { + } = \{ \mathbf { W } \in \mathbb { W } | \sum _ { i = 1 } ^ { N } W _ { i } = N _ { t } \}\]

分层随机化实验

其思想是根据协变量 \(X_i\) 将样本先划分为若干块 (Block),然后在每块内进行完全随机化实验,即

  • 将根据协变量 \(X_i\) \(N\) 个样本划分为 \(J\) 块,第 \(i\) 个单元被分到的块记为 \(B_i=B(X_i)\)

  • \(j\) 块的大小为 \(N_j\),其中有 \(N_t(j)\) 个样本接受实验处理

此时

\[\operatorname { Pr } ( \mathbf { W } | \mathbf { X } , \mathbf { Y } ( 0 ) , \mathbf { Y } ( 1 ) ) = \left\{ \begin{array} { l l } { \prod _ { j = 1 } ^ { J } \left( \begin{array} { c } { N ( j ) } \\ { N _ { t } ( j ) } \end{array} \right) ^ { - 1 } }&{ \text { if } \mathbf { W } \in \mathbb { W } ^ { + } } \\ { 0 } & { \text { otherwise } } \end{array} \right.\]

而支撑集 \(\mathbb { W } ^ { + } = \{ \mathbf { W } \in \mathbb { W } | \sum _ { i : B _ { i } = j } ^ { N } W _ { i } = N _ { \mathrm { t } } ( j ) , \text { for } j = 1,2 , \ldots , J \}\)

且可以知对于块的倾向得分为 \(e(X_i)=N_t(j)/N(j)\)

配对随机化实验

其是一个特殊的分层随机化实验——一共有 \(J=N/2\) 块,每块两个单元,且一个接受处理一个接受对照。则

\[\operatorname { Pr } ( \mathbf { W } | \mathbf { X } , \mathbf { Y } ( 0 ) , \mathbf { Y } ( 1 ) ) = \left\{ \begin{array} { l l } { 2 ^ { - N / 2 } } & { \text { if } \mathbf { W } \in \mathbb { W } ^ { + } } \\ { 0 } & { \text { otherwise } } \end{array} \right.\]

支撑集 \(\mathbb { W } ^ { + } = \{ \mathbf { w } \in \mathbb { W } | \sum _ { i : B _ { i } = j } ^ { N } W _ { i } = 1 , \text { for } j = 1,2 , \ldots , N / 2 \}\)

观察学习 (Observational studies)

相对于实验,观察学习针对的是分配机制未知或不可控的情况

Lord's Paradox

(挖坑待填)

(核心就是没有对照组,然后就是没有明确给出 \(Y_i(0)\) 填充的方式。二者一个是使用一年前的数据 \(X\) 填充,另一个是使用回归模型 \(a+bX\) 填充)

Simpson's Paradox

(挖坑待填)

(核心就是不同层的分配比例,或者说倾向性得分相差太大)

数学上,Simpson's Paradox 出现的原因是,即使 \(a_1>b_1,\ a_2>b_2\),但加权平均的结果 \(\lambda a_1+(1-\lambda)a_2\)\(\mu b_1+(1-\mu)b_2\) 的大小仍然无法确定。比如当 \(b_1>a_2\) 时,若 \(\lambda\rightarrow 0\)\(\mu\rightarrow 1\) ,就会导致加权的结果近似为 \(a_2\approx \tilde{a}<\tilde{b}\approx b_1\)