sungmoo 发表于 2010-4-22 12:53 
*手工操作(0.05~0.95,19个分位点,x的估计系数的图像)
preserve
loc s=0
版主您好~
我的编程能力极其有限,程序没太理解,就直接套用的,就是把程序中y和x换成了我的变量名称,结果显示如下:红色是出问题的地方,绿色是我加载的自己的变量。
不知道出了什么问题,能麻烦您给我看看吗?感激不尽!
. preserve
.
. loc s=0
.
. mat b=J(19,4,.)
.
. forv i=0.05(0.05)1{
2.
. loc s=`s'+1
3.
. qreg
lw m workage edu han, q(`i')
4.
. predictnl b=_b[
edu], ci(lo up)
5.
. mat b[`s',1]=`i'
6.
. mat b[`s',2]=b[1]
7.
. mat b[`s',3]=lo[1]
8.
. mat b[`s',4]=up[1]
9.
. drop b l u
10.
. }
Iteration 1: WLS sum of weighted deviations = 267.12611
Iteration 1: sum of abs. weighted deviations = 270.16683
Iteration 2: sum of abs. weighted deviations = 197.77124
Iteration 3: sum of abs. weighted deviations = 143.57681
Iteration 4: sum of abs. weighted deviations = 119.73458
Iteration 5: sum of abs. weighted deviations = 105.14784
Iteration 6: sum of abs. weighted deviations = 104.50444
Iteration 7: sum of abs. weighted deviations = 93.163863
Iteration 8: sum of abs. weighted deviations = 85.482668
Iteration 9: sum of abs. weighted deviations = 84.774639
Iteration 10: sum of abs. weighted deviations = 84.508331
Iteration 11: sum of abs. weighted deviations = 84.484432
Iteration 12: sum of abs. weighted deviations = 83.288993
Iteration 13: sum of abs. weighted deviations = 82.929077
Iteration 14: sum of abs. weighted deviations = 82.633191
Iteration 15: sum of abs. weighted deviations = 82.602378
Iteration 16: sum of abs. weighted deviations = 82.602378
Iteration 17: sum of abs. weighted deviations = 82.596511
Iteration 18: sum of abs. weighted deviations = 82.596511
Iteration 19: sum of abs. weighted deviations = 82.592156
.05 Quantile regression Number of obs = 649
Raw sum of deviations 95.82249 (about 5.7037826)
Min sum of deviations 82.59216 Pseudo R2 = 0.1381
------------------------------------------------------------------------------
lw | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
m | .2646556 .125722 2.11 0.036 .0177811 .5115302
workage | -.0119254 .0071892 -1.66 0.098 -.0260426 .0021917
edu | .1337953 .0142054 9.42 0.000 .1059008 .1616899
han | .0442619 .1429128 0.31 0.757 -.2363694 .3248932
_cons | 4.246894 .2706284 15.69 0.000 3.715474 4.778315
------------------------------------------------------------------------------
Warning: prediction constant over observations; perhaps you meant to run nlcom.
note: Confidence intervals calculated using t(644) critical values.
l ambiguous abbreviation
r(111);
.
. clear
.
. svmat b
number of observations will be reset to 19
Press any key to continue, or Break to abort
obs was 0, now 19
.
. tw rarea b3 b4 b1||scatter b2 b1,c(l)
.
. restore
.