Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • What observations are at the conditional quantile that STATA is estimating

    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!
    I am using Stata SE x64 ver 13.1 with Win 7 x64 and with 8 GB of ram.

  • #2
    Hi Karl,
    I think the problem you are having is due to a confusion of what qreg does. If you look at the stata manual notes (or any notes) on quantile regression, you will see that ALL observations are used for the estimation. The only difference is that instead of minimizing the squared of the residuals (OLS) you are minimizing the weighted sum of absolute residuals. In the case of the median (q50), this reduces to minimizing the sum of absolute residuals.
    It is not the case that only a subset of the regression is used to estimate quantile regressions.
    Perhaps there is something else in mind you want to do. If you provide a "larger" example may help trying to help you get what you need.
    HTH
    Fernando

    Comment


    • #3
      Fernando,

      Thanks for that. With your advice, I read Cameron and Trivedi chap 7 on qreg and that was a big help. I see the use of weighed sum. I will think more about this.




      I am using Stata SE x64 ver 13.1 with Win 7 x64 and with 8 GB of ram.

      Comment

      Working...
      X