Announcement

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

  • code for likelihood ratio test when estimating quantile regression?

    Hi
    I want to do a likelihood ratio test for a quantile regression model. I got the model; log_bloodvalue=gender+smoker+bmi and want to test if smoker and bmi are redundant.
    My code is;
    qreg log_BV smoker gender bmi
    estimates store myfullmodel
    regress log_BV smoker
    lrtest myfullmodel

    and Stata says;
    . lrtest myfullmodel
    myfullmodel does not contain scalar e(ll)
    r(498);

    Could someone, please, help me with the code?

  • #2
    Dear Catrin,
    if you see the stored results of qreg you can see that scalar e(ll) is not one of them. There are other post estimation options

    Comment


    • #3
      This is a complete non-starter. Quantile regression is not based on likelihood, so what you want makes no sense. That's why no likelihood results are in memory after a model fit.

      I see that you want to compare the results of qreg with one set of predictors and regress with just one of those. That's problematic in several senses.

      For better advice, back up and tell us your statistical and scientific goal here.

      Please note our strong preference for full real names here, including in your case a family name too.

      Comment


      • #4
        Dear Nick
        Thank you for you replay.

        I interpret "Quantile Regression- Theory and Applications" by Davino, Furno and Vistocco, as it is possible (see page 86, where they define such a test).

        No, I do not want to compare qreg with regress. I agree that such comparison should make no sense. I am sorry, but I wrote it by mistake. I ment;

        My code is;
        qreg log_BV smoker gender bmi
        estimates store myfullmodel
        qreg log_BV smoker
        lrtest myfullmodel

        I just want to test the noll-hypothese; gender=bmi=0. I guess I can do it by

        "
        qreg log_BV smoker gender bmi
        testnl _b[gender]=_b[bmi]
        "
        ... and I guess this is a Wald-test (but I would be happy for a confirmation)?

        Best wishes
        / Catrin Wessman, PhD



        Comment


        • #5
          Dear Alberto
          Thank you for your replay. I am a bit confused, since I interpret "Quantile Regression- Theory and Applications" by Davino, Furno and Vistocco, as it is possible (see page 86, where they define such a test).

          Where do I find information about the alternatives? I would like to test the null-hypothesis gender=bmi=0, in my model log_BV=smoker gender bmi.

          Thank you
          / Catrin Wessman, PhD

          Comment


          • #6
            Let me rephrase that: Quantile regression in Stata is not based on likelihood. I am not familiar with any implementation that is.

            Code:
             
            help qreg postestimation
            shows what is possible.

            Comment


            • #7
              Thank you Nick. The statement is most helpful.

              FYI, according to http://www2.sas.com/proceedings/sugi30/213-30.pdf, it is possilbe to do a likelihood test in SAS (page 4) - or, that is my interpretation at least.

              Thanks
              / Catrin

              Comment


              • #8
                Thank you for the reference. Page 4 of that article simply reports a "LR" test statistic. What one really needs to look at is the methods and formulae section on page 10. At first glance, this is not a true LR test and cannot be, for the reasons that Nick Cox points out. However, the article cites as a source for the "LR" test statistic the following article: Koenker, R. and Machado, A. F. (1999), “Goodness of Fit and Related Inference Processes for Quantile Regression,” Journal of the American Statistical Association, 94, 1296–1310. I have not read this. The authors are serious "heavy hitters" in this area (and the journal is of course world-leading), so I'm confident that what they derive is good. Nonetheless I remain doubtful about the label used for the test statistic in the SAS program. Joao Santos-Silva, Forum member and author of qreg2 on SSC, is better qualified than I to comment.

                "Catrin": please note Nick Cox's request in post #3, which is to conform with Forum etiquette and re-register to use your full name (firstname lastname). The FAQ explains why, and how to do it. It's easy: simply hit the Contact Us link at bottom right of page, and make the request. Thank you.

                Comment


                • #9
                  Thank you all for your time and answers. The answers increased my knowledge and removed some misinterpretations.

                  I want to apologize for my, unintended, graceless behavior. I have sent an email to the administrators, asking for help to change my contact name.

                  Best wishes
                  / Catrin Wessman

                  Comment


                  • #10
                    Dear All,

                    Apologies for the late reply. Indeed the test presented in the SAS document is the LR test of Koenker and Machado. The test is based on the asymmetric Laplace distribution for which the usual quantile regression is the ML estimator (much in the same way OLS is ML under normality). This test, however, has some limitations (see the original paper for details) and I would test the null using the Wald test: test gender bmi.

                    One thing to keep in mind is that the covariance matrix qreg uses by default is valid only under very restrictive conditions; for more robust alternatives see the vce option or install qreg2 from SSC.

                    Best wishes,

                    Joao

                    Comment


                    • #11
                      Dear Joao,

                      Can I ask if I use "test gender bmi." The result shows F statistics is exactly the same as Wald statistics?

                      Comment


                      • #12
                        Yes, the F test is a Wald test.

                        Joao

                        Comment

                        Working...
                        X