Announcement

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

  • compare coefficients with xtrifreg

    I estimated unconditional quantile regression using xtrifreg. As a next step, I would like to compare the equality of coefficients across quantiles.I am new to STATA, any guidance on how to proceed will be greatly appreciated.

  • #2
    Hi Anna
    If in understand correctly, what you are trying to do is, say, run the rifregression for quantile 10 and quantile 90, and then test if the coefficients from both sets
    If that is the case, the best alternative is to first estimate the interquantile RIF, and use that for your regression.
    If you follow the paper that explains xtrifreg or its help file, simply obtain the RIF90 RIF10, and then create a new variable RIF9010=RIF90-RIF10
    If you use this last variable as dependent variable, all coefficients will be the difference from the separate regression.
    HTH
    Fernando

    Comment


    • #3
      Thank you, Fernando! It makes perfect sense what you are suggesting, however as a new STATA user I am unable to generate RIF. If I use the command in the Borgen (2016) article I am getting the following error message:

      . rifreg Y, quantile (50) retain(q50)
      command rifreg is unrecognized
      r(199);
      If I search the help file for anything related to rifreg it takes me directly to xtrifreg.

      When I tried:
      . xtrifreg Y, quantile (50) fe i (SCHID) retain(q50)
      option retain() not allowed
      r(198);

      Any advice?

      Also to clarify my problem. I run the following commands:
      xtrifreg Y x1 x2 x3 x4 x5 x6,fe i(SCHID) quantile(.10)
      xtrifreg Y x1 x2 x3 x4 x5 x6,fe i(SCHID) quantile(.90)

      I am interested in comparing x1, x2, x3, x4, x5 and x6 across quantiles.



      Comment


      • #4
        I see. You are right, i didnt realize you couldnt retain the created rif after xtrifreg. Im currently working on a different version of rifreg commands that will soon solve problems like the ones you are facing, but, in the mean time you can do the following:
        1. Download and install rifreg in your computer. The link its https://faculty.arts.ubc.ca/nfortin/rifreg.zip. And you just need to copy it to the folder "c:\ado\personal"
        2. After its installed, do as you were trying to do with your xtrifreg option:
        Code:
        . xtrifreg Y, quantile(50) retain(q50)
        . xtrifreg Y, quantile(50) retain(q90)
        . xtrifreg Y, quantile(50) retain(q10)
        3. Create the interquartile range
        Code:
        gen q9010=q90-q10
        then simply run:
        xtset schid
        xtreg q9010 x1 x2 x3 x4 x5 x6, fe
        That should hopefully solve your current problem.
        Fernando

        Comment


        • #5
          It works beautifully! Thank you so much!

          Comment


          • #6
            Dear FernandoRios, I am really interested in conducting this comparison and I have followed your instruction. However, the link you noted in #4 does not work anymore. Could you please kindly update the link? Many thanks!

            Comment


            • #7
              You can download my version of the program
              ssc install rif
              and then use rifhdreg

              Comment


              • #8
                Great! many thanks FernandoRios !

                Comment


                • #9
                  Hello FernandoRios thank you so much for your responses to this. I am trying to run an unconditional quantile regression following the Borgen 2016 paper. I've come upon the same issues as both Anna-Mari and Tomy, I downloaded your version of the program. I am still getting an error message when I try to run xtrifreg:

                  option retain() not allowed
                  r(198);


                  Any insight would be helpful, thank you!

                  Comment


                  • #10
                    Note that xtrifreg is not mine.
                    Mine is rifhdreg. (ssc install rif)
                    Try with that one and let me know if the problem persists

                    Comment


                    • #11
                      Thank you so much! It worked very well a couple of times yesterday. I went back today to rerun it and am getting the same error each time:

                      rifhdreg y x1 x2 x3 x4 x5, rif(q(10)) retain(q10) replace over(q10)
                      qtile(): 3301 subscript invalid
                      rif_q(): - function returned error
                      <istmt>: - function returned error
                      r(3301);

                      Comment


                      • #12
                        Right, the syntax you are using is not correct. What is what you are trying to do?
                        in other words, can you restate your specific goal and problem?

                        Comment

                        Working...
                        X