Stata连享会 主页 || 视频 || 推文 || 知乎 || Bilibili 站
温馨提示: 定期 清理浏览器缓存,可以获得最佳浏览体验。
New!
lianxh
命令发布了:
随时搜索推文、Stata 资源。安装:
. ssc install lianxh
详情参见帮助文件 (有惊喜):
. help lianxh
连享会新命令:cnssc
,ihelp
,rdbalance
,gitee
,installpkg
⛳ Stata 系列推文:
作者:彭甲超 (中国地质大学)
邮箱:pengjiachao@cug.edu.cn
编者按:本文摘译自下文,特此致谢! Source:Badunenko O, Tauchmann H. Simar and Wilson two-stage efficiency analysis for Stata[J]. The Stata Journal, 2019, 19(4): 950-988. -PDF-
目录
DEA 方法作为一种非参数效率评价方法,其生产前沿面和效率值估计依赖于样本数据,因而对样本具有较强的敏感性 (Simar 和 Wilson,2007)。在利用效率值进行回归时,由于存在序列相关性、影响因素内生性等问题,传统 DEA 两阶段回归的统计推断失效 (Simar 和 Wilson,2007)。鉴于此,Simar 和 Wilson (2007) 提出的两阶段半参数 DEA 方法,描述了一个与两阶段估计程序一致的数据生成过程,提出了两个与假定的数据生成过程一致的 bootstrap 参数程序,有效避免决策单元生成效率值与影响因素回归估计的偏误问题。
传统的 DEA 两阶段法将可能会影响决策单元效率的因素统称为环境变量,环境变量与投入、产出变量不同,都是决策单元无法直接控制到的外在影响因素 (冯宗宪等,2011)。
Simar 和 Wilson 两阶段效率分析法分两步进行:
上述步骤均在一个程序内完成,不需要额外重新整理数据。Simar 和 Wilson两阶段效率分析法与随机前沿分析过程的区别在于具体的计算方法选择。
Simar 和 Wilson 两阶段效率分析法在第一阶段,需要使用投入产出数据集测算出产出 (投入) 导向的效率值。以产出导向
其中,
在获得效率估计值后的第二阶段,对于
应用最大似然估计可计算环境变量
*命令安装
cnssc install lxhget, replace
lxhget t303.pkg, install replace
lxhget t303.pkg, replace
*命令语法
simarwilson [(outputs = inputs)] [depvar] indepvars [if] [in] [weight], [options]
其中,
outputs
:代表生产数据集的产出变量;inputs
:代表投入变量,数据均为非负变量,投入和产出变量数量不得超过决策单元的数量;depvar
:为指定的被解释变量-效率值,该度量将作为因变量进入回归模型。simarwilson
期望 depvar
是一种径向效率,效率范围在 depvar
的某些值小于 1,而其他值超过 1,则 simarwilson
会发出警告,并根据指定 nounit
的方式忽略观察值;indepvar
表示解释变量。解释变量和被解释变量均不允许使用带有时间序列运算符等,如 L.
或 F.
。options
主要选项包括:
algorithm(1|2)
:指定命令使用算法 1 还是算法 2。为了计算经偏差校正的效率值,算法 2 涉及 bootstrap DEA 的引导程序。算法 2 要求指定 (output=inoput1 input2 input3)
。simarwilson
默认值为算法1;notwosided
默认命令 simarwilson
应用截断回归模型,无论效率得分在 simarwilson
第二阶段的回归模型在面向产出角度和面向投入的效率之间没有区别,因而不建议在算法 2 中使用notwoside
;rts(crs|nirs|vrs)
:指定在哪种假设下对所考虑的生产过程的规模报酬进行技术效率度量,crs 要求规模报酬不变,nirs 要求规模报酬递增,而 vrs 要求可变规模收益。默认值为 rts(vrs)
,rts()
一般通过 teradial
起作用。如果使用外部估计的效率值,则指定 rts()
无效;base(output|input)
:指定技术效率的径向度量的方向或基数。产出径向角度一般设定为 base(output)
,而投入径向角度则设定为 base(input)
。默认值为 base(output)
;invert
:设定代表是否使用 Shephard 代替 Farrell 计算技术效率。
为了说明 simarwilson
如何使用,作者讨论了国家一级的治理质量 (包括司法系统的质量) 是否对以国内生产总值 (GDP) 为产出变量的技术效率产生影响。该分析基于第 9 版 Penn World Table 数据库和世界经济论坛提供的全球竞争力报告跨国面板数据 (2018-02-26版)。两个数据库均可以在相关网站上公开获得,作者另外提供了获取全球竞争力指数 (GCI) 数据的 Stata 命令 gciget
,并将导入的数据与 Penn World Table 数据库进行合并。
gciget
,下载 GCI Excel 数据并导入。若导入数据失败则需详细参考 Stata 报错的内容并做针对性修改。. cnssc install gciget, replace
. gciget EOSQ048 EOSQ051 EOSQ144
. merge 1:1 countrycode year using "https://www.rug.nl/ggdc/docs/pwt90.dta"
teradial
命令快速估计决策单元的 DEA 效率。本文不再对 teradial
命令做介绍,感兴趣的读者可参考 Badunenko 和 Mozharovskyi (2016) 关于 teradial
命令的详细解释。. quietly generate regu = EOSQ048[_n-1] if countrycode == countrycode[_n-1]
. quietly generate prop = EOSQ051[_n-1] if countrycode == countrycode[_n-1]
. quietly generate judi = EOSQ144[_n-1] if countrycode == countrycode[_n-1]
. quietly generate lpop = ln(pop[_n-1]) if countrycode == countrycode[_n-1]
. global g_list "regu prop judi"
. global z_list "regu prop judi lpop c.regu#c.lpop c.prop#c.lpop c.judi#c.lpop"
. set level 90
. set seed 341566575
. *lxhuse simarwilson_example.dta, clear //可以直接调用上述命令生成的数据
. teradial rgdpo = ck emp hc if year == 2014 & regu <. ///
> & prop <. & judi <. & lpop <., tename(te_vrs_o) ///
> rts(vrs) base(output) noprint
. summarize te_vrs_o regu prop judi lpop if e(sample)
Variable | Obs Mean Std. Dev. Min Max
-------------+---------------------------------------------------------
te_vrs_o | 131 1.699949 .6236905 1 5.513838
regu | 131 3.435143 .6711715 1.846199 5.42263
prop | 131 4.304648 1.030568 1.610298 6.378975
judi | 131 3.897085 1.315987 1.113236 6.678279
lpop | 131 2.566502 1.586448 -1.264066 7.217087
其中,te_car_o 为决策单元的 DEA 效率值,使用 teradial
程序计算得出,效率值范围为
在第二阶段回归部分,作者使用三种模型分别回归并作对比,这三种模型均适用截断数据类型。此外,在回归结束作者也计算了相关变量的边际效应,以便对比主要变量的计算结果及其 95% 置信区间。
作者首先利用 tobit
模型估算回归系数,tobit
模型的输出表明,有 18 个国家的技术效率是完全有效的,而有 113 个国家的技术效率是无效的。估计结果表明司法独立质量并未对技术效率产生显著影响。
. tobit te_vrs_o $z_list, ll(1) nolstretch vsquish
Tobit regression Number of obs = 131
Uncensored = 113
Limits: lower = 1 Left-censored = 18
upper = +inf Right-censored = 0
LR chi2(7) = 20.43
Prob > chi2 = 0.0047
Log likelihood = -128.7102 Pseudo R2 = 0.0735
------------------------------------------------------------------------------
te_vrs_o | Coef. Std. Err. t P>|t| [90% Conf. Interval]
-------------+----------------------------------------------------------------
regu | -.3925008 .2014823 -1.95 0.054 -.7264042 -.0585973
prop | -.5199721 .2574393 -2.02 0.046 -.9466096 -.0933347
judi | .2488415 .1888903 1.32 0.190 -.064194 .5618771
lpop | -.8211409 .2667289 -3.08 0.003 -1.263173 -.3791084
c.regu#|
c.lpop | .1484147 .0687327 2.16 0.033 .0345084 .2623209
c.prop#|
c.lpop | .1251518 .0871451 1.44 0.153 -.0192682 .2695717
c.judi#|
c.lpop | -.0858924 .0693701 -1.24 0.218 -.2008549 .0290701
_cons | 4.589835 .7747277 5.92 0.000 3.305929 5.873741
-------------+----------------------------------------------------------------
var(e.te_v~o)| .4098449 .0562185 .3265083 .514452
------------------------------------------------------------------------------
. quietly margins, dydx($g_list) predict(ystar(1,.)) post
. estimates store tobit
作者使用 truncreg
替换 tobit
进行回归,此方法会删除 te_vrs_o = 1 的观测值。估计结果的系数与 tobit
得出的系数相比存在较大差异,但是主要指标符号与 tobit
的估计结果相似。根据 truncreg
的结果,司法质量变量似乎对效率又存在重要影响,因为 judi
及其与 lpop
的交互作用在 10% 的水平上具有统计学意义。但根据 Simar 和 Wilson (2007) 的观点,该结果可能是错误估计的标准误差产物。
. truncreg te_vrs_o $z_list, ll(1) nolstretch vsquish
Truncated regression
Limit: lower = 1 Number of obs = 113
upper = +inf Wald chi2(7) = 18.90
Log likelihood = -67.606307 Prob > chi2 = 0.0085
------------------------------------------------------------------------------
te_vrs_o | Coef. Std. Err. z P>|z| [90% Conf. Interval]
-------------+----------------------------------------------------------------
regu | -.9258069 .4299483 -2.15 0.031 -1.633009 -.2186048
prop | -1.243902 .4991533 -2.49 0.013 -2.064936 -.4228676
judi | .7784162 .3780368 2.06 0.039 .156601 1.400231
lpop | -1.739993 .5952224 -2.92 0.003 -2.719046 -.760939
c.regu#|
c.lpop | .4253728 .1720618 2.47 0.013 .1423563 .7083893
c.prop#|
c.lpop | .2581352 .1794841 1.44 0.150 -.0370899 .5533604
c.judi#|
c.lpop | -.2592945 .1497392 -1.73 0.083 -.5055935 -.0129955
_cons | 7.447817 1.629842 4.57 0.000 4.766965 10.12867
-------------+----------------------------------------------------------------
/sigma | .7222912 .0925133 7.81 0.000 .5701204 .8744621
------------------------------------------------------------------------------
. quietly margins, dydx($g_list) predict(e(1,.)) post
. estimates store truncreg
对比 tobit
和 truncreg
的结果发现部分指标显著性存在较大差异,相关统计结论存在矛盾。作者进而使用 simarwilson,algorithm(1)
。由于外部估计的效率值已可得,因此并未选择 algorithm(2)
重新测算决策单元 DEA。
. simarwilson te_vrs_o $z_list, reps(2000)
Simar & Wilson (2007) eff. analysis Number of obs = 113
(algorithm #1) Number of efficient DMUs = 18
Number of bootstr. reps = 2000
Wald chi2(7) = 21.73
inefficient if te_vrs_o > 1 Prob > chi2(7) = 0.0028
------------------------------------------------------------------------------
Data Envelopment Analysis: externally estimated scores
------------------------------------------------------------------------------
| Observed Bootstrap Percentile
inefficiency | Coef. Std. Err. z P>|z| [90% Conf. Interval]
-------------+----------------------------------------------------------------
te_vrs_o |
regu | -.9258068 .4016589 -2.30 0.021 -1.615472 -.2838172
prop | -1.243902 .4710721 -2.64 0.008 -2.035831 -.5066595
judi | .7784162 .3558094 2.19 0.029 .1985666 1.37162
lpop | -1.739993 .5668147 -3.07 0.002 -2.667406 -.8296476
c.regu#c.l~p | .4253728 .1606787 2.65 0.008 .1649802 .6944344
c.prop#c.l~p | .2581352 .1692995 1.52 0.127 -.013744 .541458
c.judi#c.l~p | -.2592945 .1400776 -1.85 0.064 -.4829778 -.0310317
_cons | 7.447817 1.554155 4.79 0.000 4.988534 9.972055
-------------+----------------------------------------------------------------
/sigma | .7222912 .0877159 8.23 0.000 .5537709 .8368936
------------------------------------------------------------------------------
. quietly margins, dydx($g_list) post
. estimates store alg_1
同样,作者也使用了 algorithm(2)
进行对比,通过设定产出变量与投入变量命令 (rgdpo = ck emp hc)
,以及规模报酬设定 rts(vrs) base(output)
,计算偏差校正的效率值,结果保存为 tebc(tebc_vrs_o)。作者选择在偏差校正程序中进行 1000 次抽样,高于 Simar 和 Wilson (2007) 中建议的默认值 algorithm(1)
。在此过程中,使用偏差校正后的效率值仅会对估计系数和相关的估计置信区间产生中等程度的影响。
. simarwilson (rgdpo = ck emp hc) $z_list if year == 2014, ///
> algorithm(2) rts(vrs) base(output) reps(2000) bcreps(1000) tebc(tebc_vrs_o)
Simar & Wilson (2007) eff. analysis Number of obs = 131
(algorithm #2) Number of efficient DMUs = 0
Number of bootstr. reps = 2000
Wald chi2(7) = 22.68
inefficient if tebc_vrs_o > 1 Prob > chi2(7) = 0.0019
------------------------------------------------------------------------------
Data Envelopment Analysis: Number of DMUs = 131
Number of ref. DMUs = 131
output oriented (Farrell) Number of outputs = 1
variable returns to scale Number of inputs = 3
bias corrected efficiency measure Number of reps (bc) = 1000
------------------------------------------------------------------------------
| Observed Bootstrap Percentile
inefficiency | Coef. Std. Err. z P>|z| [90% Conf. Interval]
-------------+----------------------------------------------------------------
tebc_vrs_o |
regu | -.9201204 .3862724 -2.38 0.017 -1.52417 -.2916837
prop | -1.22478 .5004945 -2.45 0.014 -2.05136 -.4246147
judi | .6783936 .3637896 1.86 0.062 .0808598 1.257295
lpop | -1.811275 .541392 -3.35 0.001 -2.749482 -.9526559
c.regu#c.l~p | .4252978 .1469749 2.89 0.004 .187592 .656865
c.prop#c.l~p | .2379666 .1738731 1.37 0.171 -.0451164 .5245239
c.judi#c.l~p | -.233081 .1396145 -1.67 0.095 -.4655615 -.003251
_cons | 7.9375 1.556916 5.10 0.000 5.415847 10.57516
-------------+----------------------------------------------------------------
/sigma | .878059 .1019516 8.61 0.000 .682763 1.015359
------------------------------------------------------------------------------
. estimates store alg_2_raw
为了定性地解释结果,作者列示了相关指标估计的平均边际效应。
. estimates table tobit truncreg alg_1 alg_2, title(Estimated mean marginal effects) p
Estimated mean marginal effects
------------------------------------------------------------------
Variable | tobit truncreg alg_1 alg_2
-------------+----------------------------------------------------
regu | -.02001409 .04003719 .0400372 .04087528
| 0.8110 0.6720 0.6606 0.6825
prop | -.17286701 -.33398801 -.33398801 -.34014625
| 0.1211 0.0049 0.0041 0.0123
judi | .02948397 .08804266 .08804266 .0666363
| 0.7278 0.3449 0.3318 0.5163
------------------------------------------------------------------
legend: b/p
作者使用 Shephard 距离函数代替 Farrell 距离函数计算技术效率的估计结果:
. simarwilson (rgdpo = ck emp hc) $z_list if year == 2014, ///
> algorithm(2) rts(vrs) base(output) reps(2000) bcreps(1000) invert
Simar & Wilson (2007) eff. analysis Number of obs = 127
(algorithm #2) Number of efficient DMUs = 0
Number of bootstr. reps = 2000
inefficient if bcscore < 1 Wald chi2(7) = 89.13
twosided truncation Prob > chi2(7) = 0.0000
------------------------------------------------------------------------------
Data Envelopment Analysis: Number of DMUs = 131
Number of ref. DMUs = 131
output oriented (Shephard) Number of outputs = 1
variable returns to scale Number of inputs = 3
bias corrected efficiency measure Number of reps (bc) = 1000
------------------------------------------------------------------------------
| Observed Bootstrap Percentile
efficiency | Coef. Std. Err. z P>|z| [90% Conf. Interval]
-------------+----------------------------------------------------------------
bcscore |
regu | .0662122 .0369655 1.79 0.073 .0037018 .125416
prop | .2044232 .0521001 3.92 0.000 .1224288 .291366
judi | -.1061485 .0389892 -2.72 0.006 -.1727842 -.0423242
lpop | .2481779 .0502951 4.93 0.000 .1667646 .3318391
c.regu#c.l~p | -.0403068 .0127433 -3.16 0.002 -.0605227 -.0190486
c.prop#c.l~p | -.0633276 .0172019 -3.68 0.000 -.0914835 -.0354624
c.judi#c.l~p | .0521542 .0138644 3.76 0.000 .0299163 .0760144
_cons | -.3583708 .1467442 -2.44 0.015 -.598759 -.1173351
-------------+----------------------------------------------------------------
/sigma | .1199979 .0078389 15.31 0.000 .103318 .1292986
------------------------------------------------------------------------------
. quietly margins, dydx($g_list) post
. estimates store alg_2_inv
技术效率值的范围分布于
. simarwilson (rgdpo = ck emp hc) $z_list if year == 2014, ///
> algorithm(2) rts(vrs) base(output) reps(2000) bcreps(1000) ///
> invert notwosided
Simar & Wilson (2007) eff. analysis Number of obs = 131
(algorithm #2) Number of efficient DMUs = 0
Number of bootstr. reps = 2000
inefficient if bcscore < 1 Wald chi2(7) = 91.37
onesided truncation Prob > chi2(7) = 0.0000
------------------------------------------------------------------------------
Data Envelopment Analysis: Number of DMUs = 131
Number of ref. DMUs = 131
output oriented (Shephard) Number of outputs = 1
variable returns to scale Number of inputs = 3
bias corrected efficiency measure Number of reps (bc) = 1000
------------------------------------------------------------------------------
| Observed Bootstrap Percentile
efficiency | Coef. Std. Err. z P>|z| [90% Conf. Interval]
-------------+----------------------------------------------------------------
bcscore |
regu | .0377565 .043496 0.87 0.385 -.0320828 .1098107
prop | .2704309 .0561202 4.82 0.000 .1800005 .3617902
judi | -.1505538 .0407892 -3.69 0.000 -.220142 -.084482
lpop | .2510635 .0581523 4.32 0.000 .1544191 .3449913
c.regu#c.l~p | -.0297024 .0149314 -1.99 0.047 -.0559302 -.0061012
c.prop#c.l~p | -.085316 .0192125 -4.44 0.000 -.1181931 -.0530589
c.judi#c.l~p | .0694207 .0153785 4.51 0.000 .0446386 .0943499
_cons | -.4125987 .1685716 -2.45 0.014 -.6948596 -.1437014
-------------+----------------------------------------------------------------
/sigma | .1401906 .0085842 16.33 0.000 .1205959 .1490935
------------------------------------------------------------------------------
. quietly margins, dydx($g_list) post
. estimates store alg_2_notwo
作者的 Stata 命令也给出了绘制指标的边际效应代码,为节省篇幅不在此处展示,感兴趣的读者可以尝试绘制相关指标的边际效应。
local h_list "$g_list lpop"
foreach h of varlist `h_list' {
quietly sum `h' if e(sample)
local mymin = r(min)*0.98
local myxmin = ceil(`mymin')
local mymax = r(max)*1.02
local myxmax = floor(`mymax')
local mystep = (`mymax'-`mymin')/25
foreach g of varlist `h_list'{
local r_list : list h_list - h
quietly margins if e(sample), dydx(`g') at(`h' = ///
(`mymin' (`mystep') `mymax') (asobserved) `r_list')
quietly marginsplot, xlabel(`myxmin' (1) `myxmax') ///
recast(line) recastci(rarea) scheme(s2manual)
quietly graph export "simarwilson2`g'_`h'.eps", ///
as(eps) preview(off) replace fontface(Times)
}
}
simarwilson
实现了 Simar 和 Wilson (2007) 的两阶段 DEA 效率分析方法,该命令避免将 DEA 效率值与回归分析过程割裂,使其拥有相对完善的统计基础。该方法通过引入 bootstrap 方法消除传统 DEA 两阶段过程的缺陷,能够有效估算偏差校正的效率值,并通过半参数估计方法引入环境变量参与回归,有别于参数方法估计的随机前沿分析两阶段模型。
Note:产生如下推文列表的 Stata 命令为:
lianxh dea tfp prodest 边际效应, m
安装最新版lianxh
命令:
ssc install lianxh, replace
免费公开课
最新课程-直播课
专题 | 嘉宾 | 直播/回看视频 |
---|---|---|
⭐ 最新专题 | 文本分析、机器学习、效率专题、生存分析等 | |
研究设计 | 连玉君 | 我的特斯拉-实证研究设计,-幻灯片- |
面板模型 | 连玉君 | 动态面板模型,-幻灯片- |
面板模型 | 连玉君 | 直击面板数据模型 [免费公开课,2小时] |
⛳ 课程主页
⛳ 课程主页
关于我们
课程, 直播, 视频, 客服, 模型设定, 研究设计, stata, plus, 绘图, 编程, 面板, 论文重现, 可视化, RDD, DID, PSM, 合成控制法
等
连享会小程序:扫一扫,看推文,看视频……
扫码加入连享会微信群,提问交流更方便
✏ 连享会-常见问题解答:
✨ https://gitee.com/lianxh/Course/wikis
New!
lianxh
命令发布了:
随时搜索连享会推文、Stata 资源,安装命令如下:
. ssc install lianxh
使用详情参见帮助文件 (有惊喜):
. help lianxh