⏩Stata: 面板分位数回归

Stata 连享会   主页 || 视频 || 推文

3. Stata 范例

``````// 下载外部命令
. ssc install qregpd, replace
. ssc install moremata, replace
. ssc install amcmc, replace

. webuse nlswork, clear
//下载系统自带数据

**接下来考察该面板数据下，终身教职与工会是不是对工资有促进作用
. qregpd ln_wage tenure union, id(idcode) fix(year)
initial:       f(p) = -298.32357
rescale:       f(p) = -1.2889814
Iteration 0:   f(p) = -1.2889814
Iteration 1:   f(p) = -1.2889814
Iteration 2:   f(p) = -1.2889814
Iteration 3:   f(p) = -1.2889814
Iteration 4:   f(p) = -1.2889814
Iteration 5:   f(p) = -1.2889814
Iteration 6:   f(p) = -1.2889814
Iteration 7:   f(p) = -1.2889814
Iteration 8:   f(p) = -1.2889814
Iteration 9:   f(p) = -1.2889814
Iteration 10:  f(p) =   -.657829
Iteration 11:  f(p) =   -.657829
Iteration 12:  f(p) = -.57754087
Iteration 13:  f(p) = -.02146447
Iteration 14:  f(p) = -.00537403
Iteration 15:  f(p) = -.00537403
Iteration 16:  f(p) = -.00171472
Iteration 17:  f(p) = -.00164654
Iteration 18:  f(p) = -.00164654
Iteration 19:  f(p) = -.00164654
Iteration 20:  f(p) = -.00164654
Iteration 21:  f(p) = -.00164654
Iteration 22:  f(p) = -.00164654
Iteration 23:  f(p) = -.00164654

Quantile Regression for Panel Data (QRPD)
Number of obs:             19010
Number of groups:           4134
Min obs per group:             1
Max obs per group:            12
----------------------------------------------------------------------------
> --
ln_wage |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interva
> l]
-------------+--------------------------------------------------------------
> --
tenure |   .0207086   .0018158    11.40   0.000     .0171497    .02426
> 76
union |   .0922885   .0122959     7.51   0.000      .068189     .1163
> 88
----------------------------------------------------------------------------
> --
No excluded instruments - standard QRPD estimation.
``````

``````
. qregpd ln_wage tenure union, id(idcode) fix(year) optimize(mcmc) noisy dra
> ws(1000) burn(100) arate(.5) instruments(ttl_exp wks_work union)
................................................. 50: f(x) = -123.527581
................................................. 100: f(x) = -120.682312
................................................. 150: f(x) = -117.315183
................................................. 200: f(x) = -117.315183
................................................. 250: f(x) = -120.212408
................................................. 300: f(x) = -117.015253
................................................. 350: f(x) = -117.015253
................................................. 400: f(x) = -122.552629
................................................. 450: f(x) = -119.407322
................................................. 500: f(x) = -119.868838
................................................. 550: f(x) = -119.287133
................................................. 600: f(x) = -120.169668
................................................. 650: f(x) = -121.811414
................................................. 700: f(x) = -118.554969
................................................. 750: f(x) = -120.649488
................................................. 800: f(x) = -120.019606
................................................. 850: f(x) = -120.895138
................................................. 900: f(x) = -117.537294
................................................. 950: f(x) = -120.251358
................................................. 1000: f(x) = -118.942834

Quantile Regression for Panel Data (QRPD)
Number of obs:             19010
Number of groups:           4134
Min obs per group:             1
Max obs per group:            12

> --
ln_wage       Coef.   Std. Err.      z    P>z     [95% Conf. Interva
> l]

> --
tenure    .0312079   .0005661    55.13   0.000     .0300984    .03231
> 75
union    .0807607   .0065461    12.34   0.000     .0679305    .09359
> 08

> --
Excluded instruments: ttl_exp wks_work

MCMC diagonstics:
Mean acceptance rate:      0.192
Total draws:                1000
Burn-in draws:               100
Draws retained:              900
Value of objective function:
Mean:            -119.0795
Min:             -125.4123
Max:             -117.0153
MCMC notes:
*Point estimates correspond to mean of draws.
*Standard errors are derived from variance of draws.

.
``````

相关课程

http://lianxh.duanshu.com

课程一览

Stata数据清洗 游万海 直播, 2 小时，已上线

Note: 部分课程的资料，PPT 等可以前往 连享会-直播课 主页查看，下载。

关于我们

• Stata连享会 由中山大学连玉君老师团队创办，定期分享实证分析经验。直播间 有很多视频课程，可以随时观看。
• 连享会-主页知乎专栏，300+ 推文，实证分析不再抓狂。
• 公众号推文分类： 计量专题 | 分类推文 | 资源工具。推文分成 内生性 | 空间计量 | 时序面板 | 结果输出 | 交乘调节 五类，主流方法介绍一目了然：DID, RDD, IV, GMM, FE, Probit 等。
• 公众号关键词搜索/回复 功能已经上线。大家可以在公众号左下角点击键盘图标，输入简要关键词，以便快速呈现历史推文，获取工具软件和数据下载。常见关键词：`课程, 直播, 视频, 客服, 模型设定, 研究设计, stata, plus, 绘图, 编程, 面板, 论文重现, 可视化, RDD, DID, PSM, 合成控制法`

✏ 连享会学习群-常见问题解答汇总：
https://gitee.com/arlionn/WD