# Stata：面板分位数模型估计及内生性初探

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

New！ `lianxh` 命令发布了：

`. ssc install lianxh`

`. help lianxh`

Email: ht_wu@foxmail.com

## 3. Stata 范例

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

//下载系统自带数据
. webuse nlswork.dta, 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 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. Interval]
---------+-------------------------------------------------------------
tenure |   .0207086   .0018158    11.40   0.000  .0171497    .0242676
union |   .0922885   .0122959     7.51   0.000   .068189     .116388
-----------------------------------------------------------------------
No excluded instruments - standard QRPD estimation.
``````

``````
. qregpd ln_wage tenure union, id(idcode) fix(year)  ///
optimize(mcmc) noisy draws(1000) burn(100)  ///
arate(.5) instruments(ttl_exp wks_work union)

...........................................   50: f(x) = -123.527581
...........................................  100: f(x) = -120.682312
...
...........................................  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. Interval]
-----------------------------------------------------------------------
tenure    .0312079   .0005661    55.13   0.000     .0300984    .0323175
union     .0807607   .0065461    12.34   0.000     .0679305    .0935908

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.

``````

## 4. 参考资料

• Powell, David. 2015. Quantile Regression with Nonadditive Fixed Effects. RAND Labor and Population Working Paper. -Link-，内附 PDF 原文和代码。
• Powell, David. 2016. Quantile Treatment Effects in the Presence of Covariates. RAND Labor and Population Working Paper. -Link-
• Powell, David. 2014b. Did the Economic Stimulus Payments of 2008 Reduce Labor Supply? Evidence from Quantile Panel Data Estimation. RAND Labor and Population Working Paper 710-3. -Link-

## 5. 相关推文

Note：产生如下推文列表的命令为：
`lianxh 分位数, m`

`ssc install lianxh, replace`

## 相关课程

http://lianxh.duanshu.com

### 课程一览

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

#### 关于我们

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

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

New！ `lianxh` 命令发布了：

`. ssc install lianxh`

`. help lianxh`