Hello,

I am trying to figure out whether there is a procedure that would provide me with an indicator of which observations are being used for a certain quantile estimation by the qreg command.


For example:


Code:
 input var1 var2
var1 var2
1 0
2 0
3 1
4 1
5 1
1 0
2 1
3 1
4 0
5 0
 end
 clear

 qreg var1 var2, q(.5)

**Some method to identify median values and generate indicator q50 variable below
var1 var2 q50
1 0
2 0
3 1 1
4 1
5 1
1 0
2 1
3 1 1
4 0
5 0
The tricky part is when the qreg command is run with covariates. Then I think the estimation is at q(.5) at each of the different strata of the covariates (e.g. q(.5) of var1 for females and males separately).

So how do I find the q(.5) for each covariate strata that is being used on the command?

e(sample) rightly tells me the whole sample is being used but that is not the answer I'm looking for...


Thanks in advance!