Dear All, I use (please ssc install) -xtqreg- command
and obtain results as
How can I use e(b) to draw a line across different quantile (0.1 to 0.9), along with 95% confidence intervals (approximately 2 standard errors) from e(V)?
Code:
webuse grunfeld, clear xtqreg invest mvalue kstock, q(0.1(0.1)0.9) *ereturn list forvalues q = 1(1)9 { matrix list e(b_`q') matrix list e(V_`q') }
Code:
. xtqreg invest mvalue kstock, q(0.1(0.1)0.9) MM-QR regression results Number of obs = 200 .1 Quantile regression ------------------------------------------------------------------------------ | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- mvalue | .084099 .029583 2.84 0.004 .0261174 .1420805 kstock | .2646024 .0552066 4.79 0.000 .1563994 .3728054 ------------------------------------------------------------------------------ .2 Quantile regression ------------------------------------------------------------------------------ | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- mvalue | .0915338 .0237915 3.85 0.000 .0449033 .1381644 kstock | .2775904 .0444176 6.25 0.000 .1905334 .3646474 ------------------------------------------------------------------------------ .3 Quantile regression ------------------------------------------------------------------------------ | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- mvalue | .0978504 .0224984 4.35 0.000 .0537543 .1419465 kstock | .2886248 .04201 6.87 0.000 .2062867 .3709629 ------------------------------------------------------------------------------ .4 Quantile regression ------------------------------------------------------------------------------ | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- mvalue | .1031741 .0244971 4.21 0.000 .0551607 .1511875 kstock | .2979249 .0457377 6.51 0.000 .2082807 .3875691 ------------------------------------------------------------------------------ .5 Quantile regression ------------------------------------------------------------------------------ | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- mvalue | .112539 .0329018 3.42 0.001 .0480526 .1770254 kstock | .3142844 .0614081 5.12 0.000 .1939268 .434642 ------------------------------------------------------------------------------ .6 Quantile regression ------------------------------------------------------------------------------ | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- mvalue | .1164492 .0373915 3.11 0.002 .0431631 .1897353 kstock | .3211153 .0697806 4.60 0.000 .1843478 .4578827 ------------------------------------------------------------------------------ .7 Quantile regression ------------------------------------------------------------------------------ | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- mvalue | .1249394 .0484885 2.58 0.010 .0299037 .2199751 kstock | .3359468 .0904895 3.71 0.000 .1585906 .5133029 ------------------------------------------------------------------------------ .8 Quantile regression ------------------------------------------------------------------------------ | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- mvalue | .1335321 .0603947 2.21 0.027 .0151606 .2519036 kstock | .3509575 .1127063 3.11 0.002 .1300572 .5718578 ------------------------------------------------------------------------------ .9 Quantile regression ------------------------------------------------------------------------------ | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- mvalue | .149272 .0832815 1.79 0.073 -.0139567 .3125008 kstock | .3784536 .1554208 2.44 0.015 .0738345 .6830727 ------------------------------------------------------------------------------ . *ereturn list . forvalues q = 1(1)9 { 2. matrix list e(b_`q') 3. matrix list e(V_`q') 4. } e(b_1)[1,2] mvalue kstock y1 .08409896 .26460241 symmetric e(V_1)[2,2] mvalue kstock mvalue .00087515 kstock -6.865e-06 .00304777 e(b_2)[1,2] mvalue kstock y1 .09153382 .27759041 symmetric e(V_2)[2,2] mvalue kstock mvalue .00056604 kstock 5.352e-06 .00197293 e(b_3)[1,2] mvalue kstock y1 .09785037 .28862482 symmetric e(V_3)[2,2] mvalue kstock mvalue .00050618 kstock .00001066 .00176484 e(b_4)[1,2] mvalue kstock y1 .10317409 .29792486 symmetric e(V_4)[2,2] mvalue kstock mvalue .00060011 kstock .00001112 .00209193 e(b_5)[1,2] mvalue kstock y1 .11253896 .31428441 symmetric e(V_5)[2,2] mvalue kstock mvalue .00108253 kstock -3.224e-06 .00377095 e(b_6)[1,2] mvalue kstock y1 .11644922 .32111525 symmetric e(V_6)[2,2] mvalue kstock mvalue .00139813 kstock -.00002525 .00486933 e(b_7)[1,2] mvalue kstock y1 .12493937 .33594676 symmetric e(V_7)[2,2] mvalue kstock mvalue .00235113 kstock -.00003722 .00818835 e(b_8)[1,2] mvalue kstock y1 .13353212 .35095748 symmetric e(V_8)[2,2] mvalue kstock mvalue .00364752 kstock -.00007772 .01270271 e(b_9)[1,2] mvalue kstock y1 .14927204 .37845363 symmetric e(V_9)[2,2] mvalue kstock mvalue .00693581 kstock -.00013575 .02415561
Comment