Announcement

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

  • qreg options

    Hi,

    I would like to estimate a median regression without intercept. Is there anyway to drop the constant term in qreg?

    That's possible with SAS, but I would rather using STATA. Is there any command in STATA allowing to perform a median regression without intercept (i.e. with the nocons option)?

    Thanks a lot for your help!

    Olivier

  • #2
    Olivier:
    it does not seem to be feasible: https://www.stata.com/statalist/arch.../msg01197.html
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Hi Carlo,

      Thank you very much for your answer, and for the link to the discussion (which I knew, but did not find very helpful).

      I do not understand why the STATA command qreg does not have this option. This option is there with the mregress command to perform Huber regression, which is a generalization of median regression to wider class of estimators, called M-estimators. If it is possible to drop the constant for the general case of Huber regressions, why is it impossible for the specific case of median regressions?

      Do you know if there is any chance that STATA improves and updates the qreg command to allow this option (As is the case in SAS, and with the mregress command)?

      If not, can you please help me /advise me on how to create a command that does that (for someone with very low programming skills)?

      King regards

      Olivier

      Comment


      • #4
        Olivier:
        unfortunately, I cannot be of much help there.
        let's hope that some StataCorp expert will chime in.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          No one is saying it is impossible. On whether StataCorp will or may implement this, only they can speak and they don't make public promises except sometimes about what is scheduled for the next update.

          mregress is a user-written command and a law unto itself.

          My guess, unfortunately, is that this requires considerable programming skills. I would be happy to learn otherwise.

          My view is that 80% of requests I hear about to force regressions through the origin are misconceived. I am happy to guess that you are in the remaining 20%.

          Comment


          • #6
            Hi Carlo and Nick,

            Thanks a lot for your answers.

            Best,

            Olivier

            Comment


            • #7
              Dear olivier,

              Originally posted by Nick Cox View Post
              My guess, unfortunately, is that this requires considerable programming skills. I would be happy to learn otherwise.
              That is a nice challenge. See what you think of this solution:

              Code:
              syuse auto
              
              * Do median regression of price on mpg and rep78 with no intercept
              
              g double price_mpg= price/mpg
              g double rep78_mpg= rep78/mpg
              qreg price_mpg rep78_mpg [w=mpg]
              
              * the intercept is the coefficient on mpg and the slope is the coefficient on rep78
              So, I think you can do it as long as one of your regressors is strictly positive. What do you think?

              Best wishes,

              Joao

              Comment

              Working...
              X