Dear all,

I am running -qreg- for 9 deciles separately, and I want to create 3 variables containing the coefficients and confidence intervals of only the educ variable from the nine separate regressions.

The reason I am running them separately is because -sqreg- does not allow pweights.

I am aware of e(b), but that contains coefficients from all variables and I am only interested in one.

Code:
use http://fmwww.bc.edu/RePEc/bocode/o/oaxaca.dta, clear
global reg lnwage educ exper tenure age agesq
qreg $reg [pweight=wt], quantile(0.10) vce(robust,)
qreg $reg [pweight=wt], quantile(0.20) vce(robust,)
qreg $reg [pweight=wt], quantile(0.30) vce(robust,)
qreg $reg [pweight=wt], quantile(0.40) vce(robust,)
qreg $reg [pweight=wt], quantile(0.50) vce(robust,)
qreg $reg [pweight=wt], quantile(0.60) vce(robust,)
qreg $reg [pweight=wt], quantile(0.70) vce(robust,)
qreg $reg [pweight=wt], quantile(0.80) vce(robust,)
qreg $reg [pweight=wt], quantile(0.90) vce(robust,)
What I am aiming for is something like this:
quantile educoeff edulow eduup
0.1 .0844962 .0605507 .1084416
0.2 .0842375 .0718671 .096608
0.3 .0753538 .0619078 .0887999
and so on...

I saw this thread here, but I am still not very clear about what to do (never did loops before):
https://www.econjobrumors.com/topic/...iable-in-stata

I can copy and paste from the output, but was wondering if there is a more efficient way to do this.

Thanks in advance!