温馨提示: 定期 清理浏览器缓存,可以获得最佳浏览体验。
New!
lianxh
命令发布了:
随时搜索推文、Stata 资源。安装命令如下:
. ssc install lianxh
详情参见帮助文件 (有惊喜):
. help lianxh
⛳ Stata 系列推文:
作者: 李胜胜 (安徽大学)
邮箱: lisheng2@foxmail.com
目录
qregplot
可以绘制由各种程序产生分位数回归的系数,包括 qreg
, bsqreg
, sqreg
, mmqreg
和rifhdreg
(无条件分位数)。 qregplot
的工作方式与 grqreg
类似,但提供了更多选项,用户可以更好地控制所绘制的图片,还允许使用因子表示法。
该命令的工作原理如下:
qreg
命令估计)。该信息用作估计分布中分位数回归模型的模板。qregplot
根据与原始模型相同的规格估算 N 个分位数回归,选择将要用于此模型估算的分位数。qregplot
将使用 twoway rarea
绘制 CI,并使用 twoway line
绘制点估计值,从而绘制所有请求的系数。每个图片都作为图形(graph)临时存储在内存中。此过程唯一的例外是 sqreg
。 在此命令之后使用时,将从 sqreg
输出中收集系数,而不是重新估计系数。
标准误是根据原始命令估计的。例如,如果首先使用 vce(robust)
估计 qreg
,则 qregplot
将使用相同类型的标准误进行绘图。
由于分位数回归中最耗时的部分是回归本身的估计,特别是如果使用 boostrap
得到标准误,则可以使用选项 estore(name)
请求 qregplot
将所有系数和 CI 存储在内存中。这样做的好处是可以直接使用存储的系数创建图。
在所有情况下,CI 均使用与原始估算相同的置信度(通常为 95%)自动绘制。
详见连享会推文
qregplot
命令. ssc install qregplot, replace
qregplot [varlist] [, quantiles{cmd:(numlist)
cons
ols olsopt(regress options)
seed(seed number)
raopt(rarea options)
lnopt(line options)
twopt(twoway options)
grcopt(graph combine options)
estore(name )
from(name)
label labelopt(label options)} ]
varlist
:选择将要绘制图形的变量。如果未提供任何参数,则将绘制除截距以外的所有系数。也可以使用因子表示法。quantiles(numlist)
:用于绘图的分位数,可以使用任何 numlist
来做到这一点。默认值是分位数(10(5)95)。命令 sqreg
被忽略。cons
:绘制截距。ols
:要求在图形中包括标准 ols 模型的系数和 CI(通过regress
)。olsopt(regress options)
:用于提供附加信息以通过回归估算模型。例如, olsopt(robust)
请求 OLS 回归以使用稳健性的标准误来估计模型。seed(seed number)
:如果使用 bsqreg
,则需要设定种子值,以复现同样的结果。raopt(rarea options)
:提供在图表的“twoway rarea
”部分中使用的选项。这可以控制置信区间的各个方面。lnopt(line options)
:提供在图表的“twoway line
”部分中使用的选项。这控制了点估计的各个方面。twopt(twoway options)
:提供在“twoway
”图上使用的选项。结合 rarea
和 line
,它控制图的各个方面。grcopt(graph combine options)
:提供与“graph combine
”一起使用的选项。这控制了所有系数组合图的各个方面。estore(name)
:要求将所有估计的系数和 CI 保存在 e()中。这将存储在 name
的内存中。以后可以将其仅用于绘制系数图,而无需重新估计分位数回归。from(name)
:使用先前存储在 e() 中的信息绘制分位数系数。使用此选项时,可以使用一个图形特性选项。label
: 将使用变量(或值)标签用作每个分位数图的标题。默认选项是使用变量名。labelopt(options{cmd)}
:提供其他信息来处理“长”变量标签。 这两个选项是:
lines(#L)
将标签分成 #L 行。maxlength(#k)
将标签分成最大长度为 #k 的行。 如果 #k 太小而无法将标签分成 #L 行,则由行取代。
webuse womenwk,clear
qreg
的简单条件分位数回归qreg wage age education i.married children i.county
qregplot age education i.married children, q(5(2.5)95) ols
qregplot age education i.married children, q(5(2.5)95) ols raopt( color(black%5))
qregplot age education i.married children, q(5(2.5)95) ols raopt( color(black%5)) grcopt(col(1))
qregplot age education i.married children, q(5(2.5)95) ols raopt( color(black%5)) grcopt(col(1) ysize(20) xsize(8))
bsqreg
估计bsqreg wage age education i.married children i.county
qregplot age education i.married children, q(5(5)95)
qrprocess
估计ssc install qrprocess,replace (if not installed)
qrprocess wage age education i.married children i.county
qregplot age education i.married children, q(5(5)95)
qreg2
估计qreg2 wage age education i.married children i.county
qregplot age education i.married children, q(5(5)95)
Note:qreq2
需要更新
ivqreg2
估计ivqreg2 wage age education married , inst(age education married children)
qregplot age education married , q(5(5)95)
xtqreq
估计xtqreg wage age education i.married children , i(county)
qregplot age education i.married children, q(5(5)95)
mmqreg
估计mmqreg wage age education i.married children
qregplot age education i.married children, q(5(5)95)
Note:mmqreg
最新版本不支持qregplot
sqreg
估计set scheme s2color
sqreg wage age education i.married children i.county, q(10 25 50 75 90)
qregplot age education i.married children,
Note:需设置彩色背景才能正常显示。
mmqreg
估计rifhdreg wage age education i.married children i.county, rif(q(50))
qregplot age education i.married children, q(5(5)95)
qreg wage age education i.married children i.county, q(50)
qregplot age education i.married children, q(5(5)95) estore(qreg_1)
set scheme s2color
qregplot age education i.married children, from(qreg_1)
qregplot age education i.married children, from(qreg_1) label
Note:产生如下推文列表的 Stata 命令为:
lianxh 分位数
安装最新版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