Announcement

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

  • How to compute constant on fixed effects Quantile regression

    Hi,

    I know that xtqreg command does not show any constant, however, as i am working on a genetics topic, I really need to get the constant for each quantile. How can i get the constant? is there a way to compute it with the output of the regression?

    Thank you in advance.

  • #2
    Hi Daniel
    So, you cant estimate a constant with xtqreg, because the way it is programmed, it "eliminates" the constant.
    In fact, even if you were to estimate it, when you use fixed effect regressions (xtreg, areg or reghdfe), the constant is simply not identified. And the variance will be all over the place.
    However, if you want something that is comparable to the constant in linear regressions, you can try mmqreg.
    It is my take on xtqreg, but that can be used with or without fixed effects.
    HTH
    F

    Comment


    • #3
      Could you use margins?

      Comment


      • #4
        FernandoRios Hi, thank you so much for your reply!

        I understand that it eliminates the constant, however I have seen it using the command reghdfe. As I am trying to predict height to make 90-10 ratio for inequality, I really need the constant. Therefore, I will try mmqreg and tell you what happens.

        Again, Thank you so much.

        Comment


        • #5
          dear George Ford

          Thank you for your reply!

          I am quite new over quantile regression, how could I use margins in this situation?

          Comment


          • #6
            Dear Daniel Lasso,

            Fernando's suggestion is excellent, just use mmqreg and absorb the fixed effects. With xtqreg you can simply save the FE (with the option save) and then compute its average. This makes clear what is the constant in FE models, it is just the average value of the fixed effects. Are you sure that is meaningful in your context?

            Best wishes,

            Joao

            Comment


            • #7
              dear Joao Santos Silva

              First of all, thank you so much, literally your contributions had helped a lot confused people like me.

              On the other hand, i am trying to estimate height with a combined cross-section data. I am using municipalities for fixed effects as unobserved factors may explain the change or evolution on height. I tried what you said and save the FE with xtqreg, when i did that i obtained a constant that appeared as a mean height (for example, 150cm for quantile 0.1). If i understand what you said, this constant is the average of the constant + the average of the unobserved constant error (ai). Do you think that, in this model, it can be interpreted as a common constant? (if every variable is 0 then the height is 150cm). I also want to compute the 90-10 ratio for measuring inequality in height, so i need the constant to predict values.

              2) I do also have another question, if i do mmqreg with the same model i do get the same coefficients for variables, however, i get another constant for the qtile output (45cm for quantile 0.1) why is it different? how can i interpret this? also, what is location and scale estimation?


              Thank you very much, sorry for taking your time.
              Daniel.

              Comment


              • #8
                Dear Daniel Lasso,

                I am not comfortable with the idea of estimating a single "constant" in a FE model; you should talk to your advisor to check whether what you are doing is sensible. I did a quick test and I got (approximately) the same constant using mmqreg and the method I suggested so the difference you report is puzzling, but I may be missing something. Please show us your results so that we can try to understand what is going on.

                On what is location and scale estimation, I believe Fernando explained that to you in a separate thread.

                Best wishes,

                Joao

                Comment


                • #9
                  Joao Santos Silva

                  Thank you for your time and kindness, i now understand what you said. Also with fernando rios´s explanaition y understand more.

                  I am trying to explain height with quantile regression, also trying to analyse how different coefficients across cuantiles may stand for inequality.

                  Here it is the estimation for mmqreg, quantile(0.5)

                  ----------------------------------------------------------------------------------
                  Height| Coef. Std. Err. z P>|z| [95% Conf. Interval]
                  -----------------+----------------------------------------------------------------
                  location |
                  respiratorias | -.0088638 .0012515 -7.08 0.000 -.0113166 -.0064109
                  gastro | .0007742 .0017624 0.44 0.660 -.00268 .0042285
                  enfpeup | -.0097964 .0072258 -1.36 0.175 -.0239587 .0043659
                  |
                  manobra |
                  Calificada | 1.688736 .0685028 24.65 0.000 1.554473 1.822999
                  Estudiante | 1.543609 .0825145 18.71 0.000 1.381884 1.705335
                  Fuerzas armadas | 5.335495 1.19054 4.48 0.000 3.00208 7.66891
                  |
                  migra |
                  Migró | .3850637 .0725539 5.31 0.000 .2428607 .5272667
                  urbanocenso | .9292046 .0869097 10.69 0.000 .7588646 1.099545
                  _cons | 157.9775 .2206636 715.92 0.000 157.545 158.41
                  -----------------+----------------------------------------------------------------
                  scale |
                  respiratorias | -.0007278 .0007765 -0.94 0.349 -.0022498 .0007941
                  gastro | .0009266 .0010935 0.85 0.397 -.0012167 .0030699
                  enfpeup | .0031341 .0044835 0.70 0.485 -.0056534 .0119215
                  |
                  manobra |
                  Calificada | -.0398721 .0425047 -0.94 0.348 -.1231797 .0434356
                  Estudiante | -.0939667 .0511987 -1.84 0.066 -.1943143 .0063808
                  Fuerzas armadas | .6992907 .7387073 0.95 0.344 -.7485491 2.14713
                  |
                  migra |
                  Migró | .0128924 .0450183 0.29 0.775 -.0753419 .1011267
                  urbanocenso | -.0293121 .0539259 -0.54 0.587 -.1350048 .0763807
                  _cons | 4.73115 .1369176 34.55 0.000 4.462796 4.999503
                  -----------------+----------------------------------------------------------------
                  qtile |
                  respiratorias | -.0088579 .0012513 -7.08 0.000 -.0113104 -.0064054
                  gastro | .0007668 .0017622 0.44 0.663 -.002687 .0042206
                  enfpeup | -.0098217 .0072249 -1.36 0.174 -.0239821 .0043388
                  |
                  manobra |
                  Calificada | 1.689057 .0684939 24.66 0.000 1.554812 1.823303
                  Estudiante | 1.544366 .0825033 18.72 0.000 1.382662 1.70607
                  Fuerzas armadas | 5.329863 1.190384 4.48 0.000 2.996753 7.662973
                  |
                  migra |
                  Migró | .3849599 .0725445 5.31 0.000 .2427752 .5271446
                  urbanocenso | .9294407 .0868985 10.70 0.000 .7591227 1.099759
                  _cons | 157.9394 .2208162 715.25 0.000 157.5066 158.3722







                  Here is the same estimation for xtqreg

                  ----------------------------------------------------------------------------------
                  | Coef. Std. Err. z P>|z| [95% Conf. Interval]
                  -----------------+----------------------------------------------------------------
                  respiratorias | -.0040346 .0009626 -4.19 0.000 -.0059212 -.002148
                  gastro | -.0033848 .0013243 -2.56 0.011 -.0059804 -.0007892
                  enfpeup | -.0209356 .0057373 -3.65 0.000 -.0321806 -.0096907
                  |
                  manobra |
                  Calificada | 2.284792 .0665005 34.36 0.000 2.154454 2.415131
                  Estudiante | 1.630219 .0791732 20.59 0.000 1.475043 1.785396
                  Fuerzas armadas | .3639779 .1667387 2.18 0.029 .0371761 .6907797
                  |
                  migra |
                  Migró | .4103279 .0595566 6.89 0.000 .2935991 .5270568
                  urbanocenso | 1.193517 .0769499 15.51 0.000 1.042698 1.344336

                  and the constant:

                  Variable | Obs Mean Std. Dev. Min Max
                  -------------+---------------------------------------------------------
                  fextqreg | 221,337 167.1958 .8544206 159.4194 173.4962



                  You are right, the constant is almost the same. What i was wondering is that if i can predict a height for an individual by computing 167cm + 2.28(calificada=1)+ .....?

                  Also, is there any simple interpretation (in words) of the coefficients across the location and scale model? For another instance, might them be useful as an inequality measure?

                  Thank you so much for spending your time answering me.

                  Daniel.
                  Last edited by Daniel Lasso; 02 Sep 2021, 21:16.

                  Comment


                  • #10
                    Hi Daniel
                    I think you need to take a step back. You are trying to use quantile regressions for something beyond of what it is intended.
                    You should have a conversation with your advisor to better understand what is your research question, before you try to apply quantile regressions.
                    To me, it seems that you want a model that better predicts Height? but isnt clear why you want to do something like that.

                    Comment


                    • #11
                      Dear Daniel Lasso,

                      The mmqreg and xtqreg results look very different to me. Are you including fixed effects in mmqreg (xtqreg does it automatically, but mmqreg does not)?

                      Echoing what Fernando said above, I suggest you discuss this with your supervisor. You are using a reasonably sophisticated technique and you should make sure you understand it before applying it (this is true for everything!). Your supervisor should guide you on whether this technique is suitable for your problem and for your level.

                      Best wishes,

                      Joao

                      Comment


                      • #12
                        FernandoRios Joao Santos Silva

                        Thank you very much, i do understand your point. I will do that.

                        Thank you for your advice and best wishes,
                        ​​​​​​​D.

                        Comment

                        Working...
                        X