Announcement

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

  • #31
    Dear Mohammad Azeem Khan,

    I am glad you found the command helpful. Unfortunately I do not have a command to do the plots.

    Best wishes,

    Joao

    Comment


    • #32
      Originally posted by Joao Santos Silva View Post
      Dear Mohammad Azeem Khan,

      I am glad you found the command helpful. Unfortunately I do not have a command to do the plots.

      Best wishes,

      Joao
      Dear Professor Joao,
      Thanks for the excellent routine. I want to test the equality of coefficients across quantiles after xtqreg.
      Could you give me some suggestions?

      For example, we can do this with sqreg
      Code:
       sysuse auto,clear
      sqreg price weight length foreign, quantile(.25 .5 .75) reps(100)
      test [q25]weight - [q25]length=[q50]weight - [q50]length
      Also, we can test beta1 + beta2=0

      Can we do it this way?
      Code:
      matrix V = e(V_1)
      mat list V
      matrix b = e(b_1)
      mat list b
      ** five parameters in this model. test beta1 + beta3=0?
      matrix R = (1,0,1,0,0)   
      matrix r = 0
      scalar q = rowsof(R)
      ** divided by q or not?
      matrix W = (R*b'-r)'*syminv(R*V*R')*(R*b'-r)/q
      scalar Wald = W[1,1]
      scalar k = colsof(R)
      display "Wald test statistic: " Wald "  with p-value: " Ftail(q,_N-k,Wald)


      Thanks!

      Bests,
      wanhaiyou
      Last edited by wanhaiyou; 06 Apr 2019, 16:59.

      Comment


      • #33
        Dear wanhaiyou

        I am afraid that, for the moment, you will have to use bootstrap to do a test comparing coefficients at different quantiles (that is exactly what sqreg does). I hope that in the future the command will support this feature.

        Best wishes,

        Joao
        PS: To perform tests on parameters of the same quantile you should be able to use the standard test command, so there is no need to use a code as you describe.
        Last edited by Joao Santos Silva; 08 Apr 2019, 07:42.

        Comment


        • #34
          Dear Professor Joao

          This might be a stupid question, but i'm quite new to econometrics.

          By reading this part i understood that you can not cluster the standard errors with this command, but
          i wondered if the standard errors when using this command are robust to heteroskedasticity or if they are conventional?

          Best wishes,

          Thomas Brown

          Comment


          • #35
            Originally posted by Joao Santos Silva View Post
            Dear wanhaiyou

            I am afraid that, for the moment, you will have to use bootstrap to do a test comparing coefficients at different quantiles (that is exactly what sqreg does). I hope that in the future the command will support this feature.

            Best wishes,

            Joao
            PS: To perform tests on parameters of the same quantile you should be able to use the standard test command, so there is no need to use a code as you describe.
            Thanks very much, Professor Joao. Thanks for excellent routine!

            Bests,
            wanhai

            Comment


            • #36
              Dear All,

              In case you get the error "option residuals not allowed, r(198)" while running xtqreg, please update your Stata version by typing "update all".

              Best wishes,

              Joao

              Comment


              • #37
                Dear All,

                With the usual thanks to Kit Baum, an updated version of xtqreg is now available in SSC. This version allows factor variables and solves a small issue with bootstrapping the command.

                Please do let me know if you find any problems with the new version.

                Best wishes,

                Joao

                Comment


                • #38
                  Dear Professor Joao,

                  Thank you very much for updating xtqreg command and it's super useful and easy to implement.

                  One question I have is that the output table shows no constant, only the coefficients of each independent variables are reported. As a result, when I use the "predict X, xb" command, the predicted values are far away from the average of Y because no constant is added. I am wondering if there is a way to compute the constant in xtqreg?

                  Thank you very much for your help in advance. Best.

                  Li.

                  Comment


                  • #39
                    Dear Li Ma,

                    In fixed effects models the constant is not particularly meaningful because it varies across units; xtqreg reports a constant but that is just an average value. Anyway, you should be able to compute the fixed effects using the results in the paper and the output of the command, and I can try to include that in the next update.

                    Best wishes,

                    Joao

                    Comment


                    • #40
                      Hi all,

                      For my master thesis I am currently working with a mixed effects linear model in Stata. For my additional analysis I have decided to focus on a quantile regression to find more in depth information on the different quantiles of my dependent variables (firm performance), and how my independent variable affects these quantiles.

                      Since I'm using longitudinal data, I figured that I cannot use a normal quantile regression, since it does not take into account the within-subject dependency. About I week ago I discovered the Xtqreg command, and I figured I can use this command to perform my quantile regression.

                      My questions are as followed:

                      - to which extent can I use the Xtqreg command to work with multilevel (2-level) data, and is there a way to use a random intercept model here?

                      - on how far does Xtqreg differ from the QRLMM command in R?

                      - I have already tried to perform both the Mixed and the Xtqreg command. I've attached some of my quantile regression output to this post. Do you maybe have an idea why my coefficients are so high (3000+), and do you think my Quantile regression output looks fine like this?


                      The Syntax I used:


                      xtqreg r_TobinsQ_winsor r_flstrength_winsor r_fldistance_winsor Orth_Fau r_independent_mean_tmt_winsor r_finexp_mean_tmt_winsor ceoduality_mean_winsor r_age_mean_tmtlog_winsor r_tenure_mean_tmtlog_winsor r_Leverage_winsor tenureasceo_meanlog_winsor r_mba_mean_tmt_winsor r_female_mean_tmt_winsor SalesTurnoverNet_winsor AssetsTotal_winsor salesgrowth r_qboards_cur_mean_tmt_winsor Capint_winsor, quantile(.1 .25 .5 .75 .9)








                      Click image for larger version

Name:	Quantile 1.png
Views:	1
Size:	348.3 KB
ID:	1506169
                      Click image for larger version

Name:	Quantile 25.png
Views:	1
Size:	324.2 KB
ID:	1506172
                      Click image for larger version

Name:	Quantile 5.png
Views:	1
Size:	331.1 KB
ID:	1506170
                      Click image for larger version

Name:	Quantile 75.png
Views:	1
Size:	325.9 KB
ID:	1506173
                      Click image for larger version

Name:	Quantile 9.png
Views:	1
Size:	320.2 KB
ID:	1506171


                      Thank you in advance!

                      Comment


                      • #41
                        Dear Indji Tan
                        You should be aware that there are 2 user written command under the name "xtqreg".
                        The "xtqreg" that is tread refers to corresponds to the estimation of quantile regressions with fixed effects models using methods of Moments. And it is explained here
                        Machado, J.A.F. and Santos Silva, J.M.C. (2019), Quantiles via Moments, Journal of Econometrics, forthcoming.
                        There is a second command named "xtqreg" that you may be trying use which does estimate Mixed effects quantile regressions for which you can refer to here
                        https://www.stata.com/meeting/nordic...e13_bottai.pdf
                        or here in the paper Geraci and Bottai. Linear quantile mixed models. Statistics and Computing 2013

                        The R command you referred to also estimates some type of Mixed effect quantile regression models, but was proposed by different authors:
                        Delyon, B., Lavielle, M. & Moulines, E. (1999). Convergence of a stochastic approximation version of the EM algorithm. Annals of Statistics, pages 94-128.
                        Yu, K., & Zhang, J. (2005). A three-parameter asymmetric Laplace distribution and its extension. Communications in Statistics-Theory and Methods, 34(9-10), 1867-1879.

                        You may want to go through the papers and see which one is really doing what you are trying to do.
                        Best regards
                        Fernando

                        Comment


                        • #42
                          Joao Santos Silva

                          I would like to know if the current xtqreg command has the capability to be used for an IV Quantile Difference-in-difference estimation? Thank you.

                          Comment


                          • #43
                            Dear Lom Newton

                            Doing QR with FE and IV is hard. If you do not have many FE you can use ivqreg2.

                            Best wishes,

                            Joao

                            Comment


                            • #44
                              Dear Joao Santos Silva

                              Thank you very much for your response and direction. Just to clarify: I am dealing with panel data and I want to control for unit-fixed effects (i.e. panel variable) and time fixed-effects. Is the ivqreg2 suitable in this case of panel data?

                              Comment


                              • #45
                                Dear Lom Newton

                                I am afraid it is not, and I am not aware of any estimator that can deal with that and IV.

                                Best wishes,

                                Joao

                                Comment

                                Working...
                                X