双重差分及三重差分(倍差法)操作及应用手册
文章重点.双重差分/三重差分
1
简介
现代计量经济学和统计学的发展为我们的研究提供了可行的工具。倍差法来源于计量经济学的综列数据模型,是政策分析和工程评估中广为使用的一种计量经济方法。主要是应用于在混合截面数据集中,评价某一事件或政策的影响程度。该方法的基本思路是将调查样本分为两组,一组是政策或工程作用对象即“作用组”,一组是非政策或工程作用对象即“对照组”。根据作用组和对照组在政策或工程实施前后的相关信息,可以计算作用组在政策或工程实施前后某个指标(如收入)的变化量(收入增长量),同时计算对照组在政策或工程实施前后同一指标的变化量。然后计算上述两个变化量的差值(即所谓的“倍差值”)。这就是所谓的双重差分估计量(Difference in Differences,简记DD或DID),因为它是处理组差分与控制组差分之差。该法最早由Ashenfelter(1978)引入经济学,而国内最早的应用或为周黎安、陈烨(2005)。
常用的倍差法主要包括双重倍差法和三重倍差法。双重差分法(Difference-in-difference,DID)有几种其他的称谓:倍差法、差分再差分等。该方法的原理非常简单,它要求数据期至少有两期,所有的样本被分为两类:实验组和控制组,其中实验组在第一期是没有受到政策影响,此后政策开始实施,第二期就是政策实施后的结果,控制组由于一直没有受政策干预,因此其第一期和第二期都是没有政策干预的结果。双重差分方法的测算也非常简单,两次差分的效应就是政策效应。
双重差分法的假定,为了使用OLS一致地估计方程,需要作以下两个假定。
假定1:此模型设定正确。特别地,无论处理组还是控制组,其时间趋势项都是。此假定即“平行趋势假定”(parallel trend assumption)。DID最为重要和关键的前提条件:共同趋势(Common Trends)
双重差分法并不要求实验组和控制组是完全一致的,两组之间可以存在一定的差异,但是双重差分方法要求这种差异不随着时间产生变化,也就是说,处理组和对照组在政策实施之前必须具有相同的发展趋势。
假定2:暂时性冲击与政策虚拟变量不相关。这是保证双向固定效应为一致估计量(consist estimator)的重要条件。在此,可以允许个体固定效应与政策虚拟变量相关(可通过双重差分或组内变换消去,或通过LSDV法控制)。
DID允许根据个体特征进行选择,只要此特征不随时间而变;这是DID的最大优点,即可以部分地缓解因 “选择偏差”(selection bias)而导致的内生性(endogeneity)。
2
命令介绍
diff can be installed or updated from the SSC archive by running the command:
ssc install diff, replace 下载安装方法(外部命令)
The diff syntax is detailed as follows:
diff outcome_var [if] [in] [weight] ,[ options]
命令介绍:
outcome_var 结果变量
模型必选项介绍:
period(varname) Indicates the binary period variable (0: before; 1: after). Note: if your data contains a periodical frequency (monthly, quarterly, yearly, etc.), it is suggested to specify option period(varname) and include a binary variable for each frequency in option cov(varlist).
treated(varname) Indicates the binary treatment variable (0: controls; 1:treated).
可选项介绍:
cov(varlist),协变量,加上kernel可以估计倾向得分
kernel, 执行双重差分倾向得分匹配
id(varname),kernel选项要求使用
bw(#) ,核函数的带宽,默认是0.06
ktype(kernel),核函数的类型. The types are epanechnikov (the default), gaussian, biweight, uniform and tricube.
qdid(quantile),执行分位数双重差分
pscore(varname) Supplied Propensity Score.提供倾向得分
logit,进行倾向得分计算,默认probit回归Specifies logit estimation of the Propensity Score. The default is Probit.
support Performs diff on the common support of the propensity score given the option kernel.
addcov(varlist) Indicates additional covariates in addition to those specified in the estimation of the propensity score. Also use this option to specify time fixed-effects in the case of multiple time-frequency data (e.g. monthly, yearly, quarterly, etc.).
ddd(varname),三重差分 Additional category for triple difference estimation. treated(varname) is deemed as the first category and ddd(varname) the second category. This option is not compatible with options kernel, test or qdid(quantile).
SE/Robust
cluster(varname) Calculates clustered Std. Errors by varname.计算聚类标准误。
robust Calculates robust Std. Errors.稳健标准误
bs performs a Bootstrap estimation of coefficients and standard errors.
reps(int) Specifies the number of repetitions when the bs is selected. The default are 50 repetitions.
Balancing test 平衡检验
test Performs a balancing t-test of the difference in the means of the covariates between the control and treated groups in period == 0. The option test combined with kernel performs the balancing t-test with the weighted covariates. See [R] ttest
Reporting
report Displays the inference of the included covariates or the estimation of the Propensity Score when option kernel is specified.
nostar Removes the inference stars from the p-values.
3
双重差分及三重差分操作应用
案例数据介绍:cardkrueger1994
背景介绍:In this case, the authors study the impact of the increase in the minimum wage in the state of New Jersey -the treated group- on the employment level at the fast food industry. They compare the changes in the number of employees at the restaurants in this treated group to the ones of the neighbor state, Pennsylvania -the control group-. They collect a baseline in February, 1992, and a follow-up in November.
数据结构如下:
1、DID with no covariates不带协变量的估计
diff fte, t(treated) p(t)
结果为:
2、DID with covariates带协变量的估计
diff fte, t(treated) p(t) cov(bk kfc roys) diff fte, t(treated) p(t) cov(bk kfc roys) report diff fte, t(treated) p(t) cov(bk kfc roys) report bs
结果为:
. diff fte, t(treated) p(t) cov(bk kfc roys)
DIFFERENCE-IN-DIFFERENCES WITH COVARIATES
DIFFERENCE-IN-DIFFERENCES ESTIMATION RESULTS
Number of observations in the DIFF-IN-DIFF: 801
Before After
Control: 78 77 155
Treated: 326 320 646
404 397
--------------------------------------------------------
Outcome var. | fte | S. Err. | |t| | P>|t|
----------------+---------+---------+---------+---------
Before | | | |
Control | 21.161 | | |
Treated | 18.837 | | |
Diff (T-C) | -2.324 | 1.031 | -2.25 | 0.024**
After | | | |
Control | 18.758 | | |
Treated | 19.369 | | |
Diff (T-C) | 0.611 | 1.037 | 0.59 | 0.556
| | | |
Diff-in-Diff | 2.935 | 1.460 | 2.01 | 0.045**
--------------------------------------------------------
R-square: 0.19
* Means and Standard Errors are estimated by linear regression
**Inference: *** p<0.01; ** p<0.05; * p<0.1
.
. diff fte, t(treated) p(t) cov(bk kfc roys) report
DIFFERENCE-IN-DIFFERENCES WITH COVARIATES
DIFFERENCE-IN-DIFFERENCES ESTIMATION RESULTS
Number of observations in the DIFF-IN-DIFF: 801
Before After
Control: 78 77 155
Treated: 326 320 646
404 397
Report - Covariates and coefficients:
-------------------------------------------------------------------
Variable(s) | Coeff. | Std. Err. | t | P>|t|
---------------------+------------+-----------+---------+----------
bk | 0.917 | 0.889 | 1.032 | 0.303
kfc | -9.205 | 1.006 | -9.154 | 0.000
roys | -0.897 | 0.967 | -0.927 | 0.354
-------------------------------------------------------------------
--------------------------------------------------------
Outcome var. | fte | S. Err. | |t| | P>|t|
----------------+---------+---------+---------+---------
Before | | | |
Control | 21.161 | | |
Treated | 18.837 | | |
Diff (T-C) | -2.324 | 1.031 | -2.25 | 0.024**
After | | | |
Control | 18.758 | | |
Treated | 19.369 | | |
Diff (T-C) | 0.611 | 1.037 | 0.59 | 0.556
| | | |
Diff-in-Diff | 2.935 | 1.460 | 2.01 | 0.045**
--------------------------------------------------------
R-square: 0.19
* Means and Standard Errors are estimated by linear regression
**Inference: *** p<0.01; ** p<0.05; * p<0.1
.
. diff fte, t(treated) p(t) cov(bk kfc roys) report bs
DIFFERENCE-IN-DIFFERENCES WITH COVARIATES
(running regress on estimation sample)
Bootstrap replications (50)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5
.................................................. 50
DIFFERENCE-IN-DIFFERENCES ESTIMATION RESULTS
Number of observations in the DIFF-IN-DIFF: 801
Before After
Control: 78 77 155
Treated: 326 320 646
404 397
Report - Covariates and coefficients:
-------------------------------------------------------------------
Variable(s) | Coeff. | Std. Err. | z | P>|z|
---------------------+------------+-----------+---------+----------
bk | 0.917 | 0.776 | 1.182 | 0.237
kfc | -9.205 | 0.754 | -12.201 | 0.000
roys | -0.897 | 0.846 | -1.060 | 0.289
-------------------------------------------------------------------
Bootstrapped Standard Errors
--------------------------------------------------------
Outcome var. | fte | S. Err. | |t| | P>|t|
----------------+---------+---------+---------+---------
Before | | | |
Control | 21.161 | | |
Treated | 18.837 | | |
Diff (T-C) | -2.324 | 1.297 | -1.79 | 0.073*
After | | | |
Control | 18.758 | | |
Treated | 19.369 | | |
Diff (T-C) | 0.611 | 0.890 | 0.69 | 0.492
| | | |
Diff-in-Diff | 2.935 | 1.616 | 1.82 | 0.069*
--------------------------------------------------------
R-square: 0.19
* Means and Standard Errors are estimated by linear regression
**Inference: *** p<0.01; ** p<0.05; * p<0.1
.
3、Kernel Propensity Score Diff-in-Diff
diff fte, t(treated) p(t) cov(bk kfc roys) kernel rcs
diff fte, t(treated) p(t) cov(bk kfc roys) kernel rcs support
diff fte, t(treated) p(t) cov(bk kfc roys) kernel rcs support addcov(wendys)
diff fte, t(treated) p(t) kernel rcs ktype(gaussian) pscore(_ps)
diff fte, t(treated) p(t) cov(bk kfc roys) kernel rcs support addcov(wendys) bs reps(50)
结果为:
. diff fte, t(treated) p(t) cov(bk kfc roys) kernel rcs
KERNEL PROPENSITY SCORE MATCHING DIFFERENCE-IN-DIFFERENCES
Repeated Cross Section - rcs option
Matching iterations: control group at base line...
.........................................................................................................................
> .......................................................................................................................
> ......................................................................................
Matching iterations: control group at follow up...
.........................................................................................................................
> .......................................................................................................................
> ................................................................................
Matching iterations: treated group at baseline...
.........................................................................................................................
> .......................................................................................................................
> ......................................................................................
DIFFERENCE-IN-DIFFERENCES ESTIMATION RESULTS
Number of observations in the DIFF-IN-DIFF: 801
Before After
Control: 78 77 155
Treated: 326 320 646
404 397
--------------------------------------------------------
Outcome var. | fte | S. Err. | |t| | P>|t|
----------------+---------+---------+---------+---------
Before | | | |
Control | 20.040 | | |
Treated | 17.405 | | |
Diff (T-C) | -2.636 | 0.939 | -2.81 | 0.005***
After | | | |
Control | 17.341 | | |
Treated | 17.573 | | |
Diff (T-C) | 0.232 | 0.948 | 0.24 | 0.807
| | | |
Diff-in-Diff | 2.867 | 1.334 | 2.15 | 0.032**
--------------------------------------------------------
R-square: 0.01
* Means and Standard Errors are estimated by linear regression
**Inference: *** p<0.01; ** p<0.05; * p<0.1
.
. diff fte, t(treated) p(t) cov(bk kfc roys) kernel rcs support
KERNEL PROPENSITY SCORE MATCHING DIFFERENCE-IN-DIFFERENCES
Repeated Cross Section - rcs option
Estimation on common support
Matching iterations: control group at base line...
.........................................................................................................................
> .......................................................................................................................
> ......................................................................................
Matching iterations: control group at follow up...
.........................................................................................................................
> .......................................................................................................................
> ................................................................................
Matching iterations: treated group at baseline...
.........................................................................................................................
> .......................................................................................................................
> ......................................................................................
DIFFERENCE-IN-DIFFERENCES ESTIMATION RESULTS
Number of observations in the DIFF-IN-DIFF: 801
Before After
Control: 78 77 155
Treated: 326 320 646
404 397
--------------------------------------------------------
Outcome var. | fte | S. Err. | |t| | P>|t|
----------------+---------+---------+---------+---------
Before | | | |
Control | 20.040 | | |
Treated | 17.405 | | |
Diff (T-C) | -2.636 | 0.939 | -2.81 | 0.005***
After | | | |
Control | 17.341 | | |
Treated | 17.573 | | |
Diff (T-C) | 0.232 | 0.948 | 0.24 | 0.807
| | | |
Diff-in-Diff | 2.867 | 1.334 | 2.15 | 0.032**
--------------------------------------------------------
R-square: 0.01
* Means and Standard Errors are estimated by linear regression
**Inference: *** p<0.01; ** p<0.05; * p<0.1
.
. diff fte, t(treated) p(t) cov(bk kfc roys) kernel rcs support addcov(wendys)
KERNEL PROPENSITY SCORE MATCHING DIFFERENCE-IN-DIFFERENCES
Repeated Cross Section - rcs option
Estimation on common support
Matching iterations: control group at base line...
.........................................................................................................................
> .......................................................................................................................
> ......................................................................................
Matching iterations: control group at follow up...
.........................................................................................................................
> .......................................................................................................................
> ................................................................................
Matching iterations: treated group at baseline...
.........................................................................................................................
> .......................................................................................................................
> ......................................................................................
DIFFERENCE-IN-DIFFERENCES ESTIMATION RESULTS
Number of observations in the DIFF-IN-DIFF: 801
Before After
Control: 78 77 155
Treated: 326 320 646
404 397
--------------------------------------------------------
Outcome var. | fte | S. Err. | |t| | P>|t|
----------------+---------+---------+---------+---------
Before | | | |
Control | 19.874 | | |
Treated | 17.259 | | |
Diff (T-C) | -2.615 | 0.939 | -2.79 | 0.005***
After | | | |
Control | 17.171 | | |
Treated | 17.385 | | |
Diff (T-C) | 0.214 | 0.947 | 0.23 | 0.821
| | | |
Diff-in-Diff | 2.829 | 1.334 | 2.12 | 0.034**
--------------------------------------------------------
R-square: 0.02
* Means and Standard Errors are estimated by linear regression
**Inference: *** p<0.01; ** p<0.05; * p<0.1
.
. diff fte, t(treated) p(t) kernel rcs ktype(gaussian) pscore(_ps)
KERNEL PROPENSITY SCORE MATCHING DIFFERENCE-IN-DIFFERENCES
Repeated Cross Section - rcs option
Matching iterations: control group at base line...
.........................................................................................................................
> .......................................................................................................................
> ......................................................................................
Matching iterations: control group at follow up...
.........................................................................................................................
> .......................................................................................................................
> ................................................................................
Matching iterations: treated group at baseline...
.........................................................................................................................
> .......................................................................................................................
> ......................................................................................
DIFFERENCE-IN-DIFFERENCES ESTIMATION RESULTS
Number of observations in the DIFF-IN-DIFF: 801
Before After
Control: 78 77 155
Treated: 326 320 646
404 397
--------------------------------------------------------
Outcome var. | fte | S. Err. | |t| | P>|t|
----------------+---------+---------+---------+---------
Before | | | |
Control | 20.186 | | |
Treated | 17.211 | | |
Diff (T-C) | -2.975 | 0.941 | -3.16 | 0.002***
After | | | |
Control | 17.681 | | |
Treated | 17.573 | | |
Diff (T-C) | -0.109 | 0.950 | 0.11 | 0.909
| | | |
Diff-in-Diff | 2.866 | 1.337 | 2.14 | 0.032**
--------------------------------------------------------
R-square: 0.02
* Means and Standard Errors are estimated by linear regression
**Inference: *** p<0.01; ** p<0.05; * p<0.1
.
. diff fte, t(treated) p(t) cov(bk kfc roys) kernel rcs support addcov(wendys) bs reps(50)
KERNEL PROPENSITY SCORE MATCHING DIFFERENCE-IN-DIFFERENCES
Repeated Cross Section - rcs option
Estimation on common support
Matching iterations: control group at base line...
.........................................................................................................................
> .......................................................................................................................
> ......................................................................................
Matching iterations: control group at follow up...
.........................................................................................................................
> .......................................................................................................................
> ................................................................................
Matching iterations: treated group at baseline...
.........................................................................................................................
> .......................................................................................................................
> ......................................................................................
Bootstrapping...
..................................................
DIFFERENCE-IN-DIFFERENCES ESTIMATION RESULTS
Number of observations in the DIFF-IN-DIFF: 801
Before After
Control: 78 77 155
Treated: 326 320 646
404 397
Bootstrapped Standard Errors
--------------------------------------------------------
Outcome var. | fte | S. Err. | |t| | P>|t|
----------------+---------+---------+---------+---------
Before | | | |
Control | 19.874 | | |
Treated | 17.259 | | |
Diff (T-C) | -2.615 | 1.814 | -1.44 | 0.149
After | | | |
Control | 17.171 | | |
Treated | 17.385 | | |
Diff (T-C) | 0.214 | 1.208 | 0.18 | 0.859
| | | |
Diff-in-Diff | 2.829 | 2.100 | 1.35 | 0.178
--------------------------------------------------------
R-square: .
* Means and Standard Errors are estimated by linear regression
**Inference: *** p<0.01; ** p<0.05; * p<0.1
.
4、 Quantile Diff-in-Diff 分位数双重差分法
diff fte, t(treated) p(t) qdid(0.25)diff fte, t(treated) p(t) qdid(0.50)diff fte, t(treated) p(t) qdid(0.75)diff fte, t(treated) p(t) qdid(0.50) cov(bk kfc roys)diff fte, t(treated) p(t) qdid(0.50) cov(bk kfc roys) kernel id(id) diff fte, t(treated) p(t) qdid(0.50) cov(bk kfc roys) kernel rcs
结果为:
. diff fte, t(treated) p(t) qdid(0.25)
DIFFERENCE-IN-DIFFERENCES ESTIMATION RESULTS
Number of observations in the DIFF-IN-DIFF: 801
Before After
Control: 78 77 155
Treated: 326 320 646
404 397
--------------------------------------------------------
Outcome var. | fte | S. Err. | |t| | P>|t|
----------------+---------+---------+---------+---------
Before | | | |
Control | 12.500 | | |
Treated | 11.000 | | |
Diff (T-C) | -1.500 | 1.584 | -0.95 | 0.344
After | | | |
Control | 11.500 | | |
Treated | 11.500 | | |
Diff (T-C) | -0.000 | 1.658 | 0.00 | 1.000
| | | |
Diff-in-Diff | 1.500 | 2.293 | 0.65 | 0.513
--------------------------------------------------------
R-square: 0.00
* Values are estimated at the .25 quantile
**Inference: *** p<0.01; ** p<0.05; * p<0.1
.
. diff fte, t(treated) p(t) qdid(0.50)
DIFFERENCE-IN-DIFFERENCES ESTIMATION RESULTS
Number of observations in the DIFF-IN-DIFF: 801
Before After
Control: 78 77 155
Treated: 326 320 646
404 397
--------------------------------------------------------
Outcome var. | fte | S. Err. | |t| | P>|t|
----------------+---------+---------+---------+---------
Before | | | |
Control | 17.000 | | |
Treated | 16.000 | | |
Diff (T-C) | -1.000 | 1.415 | -0.71 | 0.480
After | | | |
Control | 16.000 | | |
Treated | 17.500 | | |
Diff (T-C) | 1.500 | 1.412 | 1.06 | 0.288
| | | |
Diff-in-Diff | 2.500 | 1.999 | 1.25 | 0.211
--------------------------------------------------------
R-square: 0.00
* Values are estimated at the .5 quantile
**Inference: *** p<0.01; ** p<0.05; * p<0.1
.
. diff fte, t(treated) p(t) qdid(0.75)
DIFFERENCE-IN-DIFFERENCES ESTIMATION RESULTS
Number of observations in the DIFF-IN-DIFF: 801
Before After
Control: 78 77 155
Treated: 326 320 646
404 397
--------------------------------------------------------
Outcome var. | fte | S. Err. | |t| | P>|t|
----------------+---------+---------+---------+---------
Before | | | |
Control | 25.000 | | |
Treated | 20.500 | | |
Diff (T-C) | -4.500 | 1.214 | -3.71 | 0.000***
After | | | |
Control | 22.500 | | |
Treated | 22.500 | | |
Diff (T-C) | -0.000 | 1.217 | 0.00 | 1.000
| | | |
Diff-in-Diff | 4.500 | 1.719 | 2.62 | 0.009***
--------------------------------------------------------
R-square: 0.01
* Values are estimated at the .75 quantile
**Inference: *** p<0.01; ** p<0.05; * p<0.1
.
. diff fte, t(treated) p(t) qdid(0.50) cov(bk kfc roys)
QUANTILE DIFFERENCE-IN-DIFFERENCES WITH COVARIATES
DIFFERENCE-IN-DIFFERENCES ESTIMATION RESULTS
Number of observations in the DIFF-IN-DIFF: 801
Before After
Control: 78 77 155
Treated: 326 320 646
404 397
--------------------------------------------------------
Outcome var. | fte | S. Err. | |t| | P>|t|
----------------+---------+---------+---------+---------
Before | | | |
Control | 17.750 | | |
Treated | 17.250 | | |
Diff (T-C) | -0.500 | 1.013 | -0.49 | 0.622
After | | | |
Control | 17.750 | | |
Treated | 17.750 | | |
Diff (T-C) | -0.000 | 1.007 | 0.00 | 1.000
| | | |
Diff-in-Diff | 0.500 | 1.426 | 0.35 | 0.726
--------------------------------------------------------
R-square: 0.15
* Values are estimated at the .5 quantile
**Inference: *** p<0.01; ** p<0.05; * p<0.1
5、Balancing test of covariates.包含协变量的控制组与实验组之间差异检验
diff fte, t(treated) p(t) cov(bk kfc roys wendys) test
diff fte, t(treated) p(t) cov(bk kfc roys wendys) test id(id) kernel
diff fte, t(treated) p(t) cov(bk kfc roys wendys) test kernel rcs
结果为:
diff fte, t(treated) p(t) cov(bk kfc roys wendys) test
TWO-SAMPLE T TEST
Number of observations (baseline): 404
Before After
Control: 78 - 78
Treated: 326 - 326
404 -
t-test at period = 0:
----------------------------------------------------------------------------------------------
Variable(s) | Mean Control | Mean Treated | Diff. | |t| | Pr(|T|>|t|)
---------------------+------------------+--------------+------------+---------+---------------
fte | 19.949 | 17.065 | -2.884 | 2.44 | 0.0150**
bk | 0.436 | 0.408 | -0.028 | 0.45 | 0.6538
kfc | 0.154 | 0.209 | 0.055 | 1.09 | 0.2769
roys | 0.218 | 0.252 | 0.034 | 0.62 | 0.5368
wendys | 0.192 | 0.132 | -0.060 | 1.37 | 0.1726
----------------------------------------------------------------------------------------------
*** p<0.01; ** p<0.05; * p<0.1
.
. diff fte, t(treated) p(t) cov(bk kfc roys wendys) test id(id) kernel
Matching iterations...
.........................................................................................................................
> .......................................................................................................................
> ......................................................................................
TWO-SAMPLE T TEST
Number of observations (baseline): 404
Before After
Control: 78 - 78
Treated: 326 - 326
404 -
t-test at period = 0:
----------------------------------------------------------------------------------------------
Weighted Variable(s) | Mean Control | Mean Treated | Diff. | |t| | Pr(|T|>|t|)
---------------------+------------------+--------------+------------+---------+---------------
fte | 20.040 | 17.065 | -2.975 | 2.89 | 0.0041***
bk | 0.468 | 0.408 | -0.060 | 1.21 | 0.2259
kfc | 0.144 | 0.209 | 0.064 | 1.69 | 0.0911*
roys | 0.272 | 0.252 | -0.020 | 0.46 | 0.6462
wendys | 0.116 | 0.132 | 0.016 | 0.48 | 0.6296
----------------------------------------------------------------------------------------------
*** p<0.01; ** p<0.05; * p<0.1
Attention: option kernel weighs variables in cov(varlist)
Means and t-test are estimated by linear regression
.
. diff fte, t(treated) p(t) cov(bk kfc roys wendys) test kernel rcs
Matching iterations: control group at base line...
.........................................................................................................................
> .......................................................................................................................
> ......................................................................................
Matching iterations: control group at follow up...
.........................................................................................................................
> .......................................................................................................................
> ................................................................................
Matching iterations: treated group at baseline...
.........................................................................................................................
> .......................................................................................................................
> ......................................................................................
TWO-SAMPLE T TEST
Number of observations (baseline): 404
Before After
Control: 78 - 78
Treated: 326 - 326
404 -
t-test at period = 0:
----------------------------------------------------------------------------------------------
Weighted Variable(s) | Mean Control | Mean Treated | Diff. | |t| | Pr(|T|>|t|)
---------------------+------------------+--------------+------------+---------+---------------
fte | 20.040 | 17.405 | -2.636 | 2.55 | 0.0111**
bk | 0.468 | 0.434 | -0.034 | 0.68 | 0.4968
kfc | 0.144 | 0.175 | 0.030 | 0.83 | 0.4083
roys | 0.272 | 0.290 | 0.018 | 0.40 | 0.6879
wendys | 0.116 | 0.102 | -0.014 | 0.47 | 0.6413
----------------------------------------------------------------------------------------------
*** p<0.01; ** p<0.05; * p<0.1
Attention: option kernel weighs variables in cov(varlist)
Means and t-test are estimated by linear regression
6. Triple differences (consider bk is a second treatment category).
三重差分法
diff fte, t(treated) p(t) ddd(bk)
结果为:
. diff fte, t(treated) p(t) ddd(bk)
TRIPLE DIFFERENCE (DDD) ESTIMATION RESULTS
Notation of DDD:
Control (A) treated = 0 and bk = 1
Control (B) treated = 0 and bk = 0
Treated (A) treated = 1 and bk = 1
Treated (B) treated = 1 and bk = 0
Number of observations in the DDD: 801
Before After
Control (A):34 35 69
Control (B):44 42 86
Treated (A):133 132 265
Treated (B):193 188 381
404 397
--------------------------------------------------------
Outcome var. | fte | S. Err. | |t| | P>|t|
----------------+---------+---------+---------+---------
Before | | | |
Control (A) | 25.654 | | |
Control (B) | 15.540 | | |
Treated (A) | 18.547 | | |
Treated (B) | 16.044 | | |
Diff (T-C) | -7.612 | 2.206 | 3.45 | 0.001***
After | | | |
Control (A) | 22.193 | | |
Control (B) | 13.667 | | |
Treated (A) | 19.913 | | |
Treated (B) | 15.930 | | |
Diff (T-C) | -4.543 | 2.214 | 2.05 | 0.040**
| | | |
DDD | 3.069 | 3.125 | 0.98 | 0.326
--------------------------------------------------------
R-square: 0.09
* Means and Standard Errors are estimated by linear regression
**Inference: *** p<0.01; ** p<0.05; * p<0.1