Announcement

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

  • #16
    Kidaya Ntoko, how to do the Hausman test after xtpmg is explained in Blackburn & Frank (2007), I explain how to the do hausman test after xtdcce2 in Ditzen (2018). Note however that the Hausman test has some problems in large N, large T panels, see Pesaran & Yamagata (2008).


    References:
    Blackburne, E. F., & Frank, M. W. (2007). Estimation of nonstationary heterogeneous panels. The Stata Journal, 7(2), 197–208.
    Ditzen, J. (2018). Estimating dynamic common-correlated effects in Stata. The Stata Journal, 18(3), 585–617.
    Pesaran, M. H., and T. Yamagata. (2008). Testing slope homogeneity in large panels. Journal of Econometrics 142(1): 50–93.

    Comment


    • #17
      Thanks.

      Comment


      • #18
        Jan, Please could you send me the command xtdcee2 for Hausman test?

        Comment


        • #19
          The estimation results are stored in Stata und the terms pmg, mg and DFE. Hence, you can simply use the -hausman- command.
          Code:
          hausman mg pmg, sigmamore
          see
          Code:
          help hausman
          for further specifications if desired.

          Best regards
          Philipp

          Comment


          • #20
            Dear Philipp are you familiar with xtdcee2?

            Best,

            Kidaya

            Comment


            • #21
              Unfortunately not, only used -xtpmg- so far

              Comment


              • #22
                Thanks Philipp.

                Comment


                • #23
                  Dear Kidaya, Please visit https://sites.google.com/site/jandge...rch?authuser=0, and take a look of Estimating Dynamic Common Correlated Effects in Stata. 2018,and Estimating Long Run Effects in Stata using xtdcce2.
                  Ho-Chuan (River) Huang
                  Stata 17.0, MP(4)

                  Comment


                  • #24
                    Dear Huang, In my MPG model shows an ECT, less than 1 but positive; while MG model has an ECT negative and less than 1. I run an hausman test, Prob>chi2 = 0.3291. How can Interpret this result? what else (test) should I run?
                    Thanks.


                    Comment


                    • #25
                      Dear Kidaya, To my personal experience, your result is uncommon (an ECT, less than 1 but "positive"). You probably have to respecify your regressions, and to see if this is improved.
                      Ho-Chuan (River) Huang
                      Stata 17.0, MP(4)

                      Comment


                      • #26
                        Thanks.

                        Comment


                        • #27
                          Dear all,

                          I am currently trying to perform the Hausman test comparing the MG, PMG and DFE methods. Like most of you, STATA (15.1 in my case) fails to deliver a result for the MG estimate. I tried to implement Jan's file into my STATA but without success. Could one of you guide me through the procedure to resolve this issue?

                          For now, I tried to add the file in my "C:\ado\plus\x" folder, which is also where STATA seemed to save my xtdcce files. I also tried to delete the original xtpmg.ado, but it did not fix the issue.

                          Additionally, I performed the Hausman test for the DFE and PMG estimation and found that DFE is preferable. In that instance, in case I fail to resolve this issue, would it be wise to assume that DFE is preferable, without testing for MG?

                          Thank you in advance!

                          Michel

                          Comment


                          • #28
                            Hi Jan, I am the proud discoverer of the bug in the Stata's -predict- and -_predict-, which Stata Corp have resolved in somewhat not very satisfactory fashion in Stata 15.1.

                            Therefore you guys can thank me for the fact that the user written -xtpmg- is no longer working under Stata 15.1 :-).

                            If you are interested in what was the problem that the Stata 15.1 fix tries to solve, here is my original thread describing the bug in -predict-.

                            https://www.statalist.org/forums/for...r-went-missing

                            As to Jan's question, I looked through the code and it seems to me that
                            a) the authors of -xtpmg- have done nothing wrong
                            b) the Stata 15.1 fix is not satisfactory, because now Stata does not really check whether you have a variable ec in the data, but checks whether such a name ec appears in e(b).




                            Originally posted by JanDitzen View Post
                            I can confirm the problem in Stata 16 (16.0, latest update). Using Stata 15.0 it still works, but with 15.1 it does not work. In Stata 14.2 it is working. Thus there must have been a change from 15.0 to 15.1.

                            Using trace, xtpmg stops working when predicting fitted values. The command line is:
                            Code:
                            _predict double ec if __000003, eq(ec)
                            xtpmg does not come with it's own predict command, it uses Stata's _predict command. There was an update to predict on 20 February 2019, see help whatsnew15. The change reads:


                            Is my reading that correct, that predicted values were invalid?

                            I had a further look at the code of xtpmg and it looks like the predicted values are not required. When removing the lines, xtpmg works and I obtain the same results. I attached the ado file and called the program xtpmg2. Please check.

                            Jan

                            Comment


                            • #29
                              As for -xtpmg- I managed to make the command work by replacing the block of code around line 383 which used to read:
                              Code:
                              quie predict double `ec' if `touse', eq(`ec')
                                  quie gen `ec'=$LRy-`ec'
                              by the block of code
                              Code:
                              tempname myec
                                  quie predict double `myec' if `touse', eq(`ec')
                                  quie gen `ec'=$LRy-`myec'
                              I have no idea what the code is doing, I just know what is generating the problem, and I mechanically resolved the problem.

                              Comment


                              • #30
                                Hi Joro,
                                that is interesting to know - thanks.

                                Your workaround is much neater as it preserves the code and the variables.

                                Thanks!

                                Comment

                                Working...
                                X