Announcement

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

  • How do I test equivalence of estimates across different quantiles run by qreg2?

    Dear Statalisters,

    I am running a quantile regression of the form below using qreg2 by J.A.F. Machado, P.M.D.C. Parente, and J.M.C. Santos Silva
    Code:
    qreg2 y x1 x2 x3 x4 x5 x6 x7 y2 - y5 if wanted1==5, cluster(unit) wlsiter(60) quantile(0.5)
    . I wanted to run it for some percentiles (.1, .25, .5, .75, .99.8) and then run a test of equivalence of the estimates (say for x2) across the specified percentiles). From checks on the list so far, I only come across examples with sqreg.
    I would be grateful if I get help on doing this test with qreg2.

    Thanks.

    Cobby.

  • #2
    Dear Cobby Stoneson,

    To test restrictions involving parameters from different quantiles you need the covariance between them and qreg2 does not give you that. sqreg computes the covariance by bootstrap but as far as I know it does not allow clustering (but I may be wrong!). I guess that you will need to use the bootstrap command with the right clustering to get what you want.

    Best wishes,

    Joao

    Comment


    • #3
      note that Joao Santos Silva 's response is not (obviously) relevant to a test of equivalence - so, in #1, do you really mean an equivalence test or do you mean a more common test of whether they differ; if you don't understand the difference between these, you might want to see https://en.wikipedia.org/wiki/Equivalence_test (which only scratches the surface)

      Comment


      • #4
        Rich Goldstein , I actually wanted to test if they defer. Thank you for the education. How do I go about it then?

        Joao Santos Silva, I would like to know if the sqreg does the same estimation as qreg2.
        And also would you kindly throw more light on what you meant by using the bootstrap command with the right clustering? I am using a five-year panel with just around 7000 observations involving about 1400 clusters (individuals). I want to cluster by individuals.
        I am using the qreg2 to do the pooled quantile regression based on the correlated random model (Mundlak device) that your good self and Jeff Wooldridge recommended for short panels in another thread.


        Originally posted by Joao Santos Silva View Post
        Originally posted by Joao Santos Silva View Post

        T=5 is too short for xtqreg. You can try it , but I would go for the "correlated fixed effects" (or Mundlak device) mentioned in the posts above.

        Best wishes,

        Joao



        Originally posted by Jeff Wooldridge View Post
        Assuming a balanced panel, the following should work. z1 ... zJ do not change over time, the xk do. I'm showing for the median and with time dummies.
        Originally posted by Jeff Wooldridge View Post

        Code:
        egen x1bar = mean(x1), by(id)
        Code:
        egen x2bar = mean(x2), by(id)
        ...
        egen xKbar = mean(xK), by(id)
        qreg2 y d2 ... dT z1 ... zJ x1 ... xK x1bar ... xKbar, q(.5) cluster(id)




        Thank you.

        Cobby.

        Comment


        • #5
          Dear Cobby Stoneson,

          The estimation is the same, only the standard errors differ. Please check the documentation for the bootstrap command to see how to use it with clustering.

          Best wishes,

          Joao

          Comment


          • #6
            Dear Joao Santos Silva , checking the pdf documentation that pops up in the -help sqreg- (help file) does not give me any clear idea as to how to set the bootsrap to cluster standard errors at the panel id (individual) level. The example of command I see in both he help file and the pdf documentation is
            Code:
             sqreg price weight length foreign, quantile(.25 .5 .75) reps(100)
            .

            Does this inherently cluster by id?

            Comment


            • #7
              Dear Cobby Stoneson

              Please check the documentation for the bootstrap command to see how to use it with clustering.

              Best wishes,

              Joao

              Comment


              • #8
                Dear Joao Santos Silva
                I am very new to gravity model , your kind suggestion on the model and results would help me a lot

                ppml Xijt gi gj logpij lognij exchange linder3 Cost RTA contig lang Landlocked

                note: checking the existence of the estimates
                WARNING: Xijt has very large values, consider rescaling
                WARNING: gi has very large values, consider rescaling or recentering
                WARNING: gj has very large values, consider rescaling or recentering
                WARNING: exchange has very large values, consider rescaling or recentering
                WARNING: Cost has very large values, consider rescaling or recentering
                note: starting ppml estimation
                note: Xijt has noninteger values

                Iteration 1: deviance = 3.93e+09
                Iteration 2: deviance = 3.12e+09
                Iteration 3: deviance = 3.03e+09
                Iteration 4: deviance = 3.00e+09
                Iteration 5: deviance = 2.91e+09
                Iteration 6: deviance = 2.86e+09
                Iteration 7: deviance = 2.86e+09
                Iteration 8: deviance = 2.86e+09
                Iteration 9: deviance = 2.86e+09
                Iteration 10: deviance = 2.86e+09
                Iteration 11: deviance = 2.86e+09
                Iteration 12: deviance = 2.86e+09
                Iteration 13: deviance = 2.86e+09
                Iteration 14: deviance = 2.86e+09
                Iteration 15: deviance = 2.86e+09
                Iteration 16: deviance = 2.86e+09
                Iteration 17: deviance = 2.86e+09
                Iteration 18: deviance = 2.86e+09
                Iteration 19: deviance = 2.86e+09
                Iteration 20: deviance = 2.86e+09

                Number of parameters: 12
                Number of observations: 3922
                Number of observations dropped: 0
                Pseudo log-likelihood: -1.449e+09
                R-squared: .58449951
                ------------------------------------------------------------------------------
                | Robust
                Xijt | Coef. Std. Err. z P>|z| [95% Conf. Interval]
                -------------+----------------------------------------------------------------
                gi | .0452378 .0037543 12.05 0.000 .0378794 .0525962
                gj | -.0087716 .0037564 -2.34 0.020 -.016134 -.0014093
                logpij | -.7586275 .1582948 -4.79 0.000 -1.06888 -.4483754
                lognij | 1.95404 .13085 14.93 0.000 1.697579 2.210502
                exchange | .0006345 .0004417 1.44 0.151 -.0002312 .0015003
                linder3 | -.2784518 .1139317 -2.44 0.015 -.5017539 -.0551497
                Cost | -.4860289 .1373231 -3.54 0.000 -.7551772 -.2168805
                RTA | .5449323 .0897372 6.07 0.000 .3690506 .7208139
                contig | .6506576 .1505984 4.32 0.000 .3554902 .945825
                lang | .1742402 .0724501 2.40 0.016 .0322406 .3162399
                Landlocked | -.6947127 .1333741 -5.21 0.000 -.9561212 -.4333043
                _cons | -2.561144 .5722439 -4.48 0.000 -3.682722 -1.439567
                ------------------------------------------------------------------------------
                Number of regressors dropped to ensure that the estimates exist: 0
                Option strict is off

                Comment

                Working...
                X