楼主: tmdxyz
29198 38

[作图问题求助] 如何画分位数回归后的这种图 [推广有奖]

31
lihoujian 发表于 2013-6-8 10:47:21
*******************
sysuse auto
preserve
loc s=0
mat b=J(19,4,.)
forv i=0.05(0.05)1{
loc s=`s'+1
qreg price weight length foreign , q(`i')
predictnl b=_b[weight], ci(lo up)
mat b[`s',1]=`i'
mat b[`s',2]=b[1]
mat b[`s',3]=lo[1]
mat b[`s',4]=up[1]
drop b lo u
}

clear
svmat b
tw rarea b3 b4 b1||scatter b2 b1,c(l)
restore

*********************
我感觉程序应该是这样的:
*******************
sysuse auto
preserve
loc s=0
mat b=J(19,4,.)
forv i=0.05(0.05)1{
loc s=`s'+1
qreg price weight length foreign , q(`i')
predictnl b=_b[weight], ci(lo up)
mat b[`s',1]=`i'
mat b[`s',2]=b[1]
mat b[`s',3]=lo[1]
mat b[`s',4]=up[1]
drop b lo up
}

clear
svmat b
tw rarea b3 b4 b1||scatter b2 b1,c(l)
restore

*********************



懂得放弃才会拥有

32
SpencerMeng 在职认证  发表于 2014-4-9 16:54:11
太有用了  谢谢各位~~!谢谢
有问题来发帖,来发帖没问题!
我尊重版规,一切为了学术!
Stata专版版规:https://bbs.pinggu.org/thread-1651470-1-1.html

33
gssdzc 在职认证  发表于 2014-9-15 21:12:04
非常感谢分享

34
crystal8832 学生认证  发表于 2014-9-16 10:55:14
lihoujian 发表于 2013-6-8 10:47
我感觉程序应该是这样的:
*******************
sysuse auto
如果变量中没有与up开头字母重复的,u可以自动识别成up

35
yanzhen2009 发表于 2015-2-9 20:04:03
太有用了,非常感谢各位高手的命令分享

36
beiluo08 学生认证  发表于 2017-11-8 11:34:37
sungmoo 发表于 2012-11-12 13:51
*画变量x1的0.05~0.95分位回归系数图(另一种作法)
forv i=5(5)95{
qreg y x*, q(`i')
请教下,您的命令好像这一步有点问题
destring _v, g(q) i("b l u")
提示 _varname contains characters not specified in ignore(); no generate

37
tianwk 发表于 2020-2-17 15:11:29
thanks for sharing

38
duyunhan 发表于 2020-3-2 10:42:08
h3327156 发表于 2011-8-13 00:18
这一题测好久…
我的感觉啦!
sungmoo版主用法都很精简。
drop b lo u的u应该为up,不然会出u ambiguous abbreviation的警告

39
小马儿~ 学生认证  发表于 2020-7-8 14:17:10
voodoo 发表于 2010-4-22 12:29
有个现成的命令grqreg帮你得到你要的
ssc install grqreg
help grqreg
厉害,大神!

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-29 16:51