Announcement

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

  • Reset test after xtreg & xi:reg

    Hello,

    I am trying to perform Ramsey's Reset test after a regression with xtreg command, but i get an error like: "last estimates not found". Below i post my code;

    Code:
    xtreg mydep_var myvar1 myvar2 myvar3 i.year, fe robust
    Could you say, what is the reason for this? And is it possible to perform it in any other way?

    As you might know, xtreg takes panel group as a fixed effects by default. My panel group is pair of individuals. Taking this into account, i do the same regression with reg command as below;

    Code:
    xi: reg mydep_var myvar1 myvar2 myvar3 i.year i.indi_i i.indi_j, cluster (in_ij)
    This time i can perform ovtest but i am not sure whether it is equal to perform ovtest with the xtreg command or not. Pls, would you comment on this?

    Thank you for your response in advance.

    Regards,
    Ima


  • #2
    Yusu:
    welcome to the list.
    Some remarks about your query.
    -xtreg- takes -re- (not -fe-) specification by default;
    -xtreg- does not support -estat ovtest-, while -regression- does;
    -xi- is pleonastic in your last code, as -i.variable- does all the job;
    you may want to perform -estat ovtest- after your last code (deleting -xi- at the beginning).
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Mr Carlo,

      Thank you for your input.

      By saying "xtreg takes panel group as a fixed effects by default", I meant if we put fe option, then xtreg will take panel variable as a fixed effect. In my case panel variable is the interaction of pair of individuals, so it would take the pair as a fixed effect, am i right?

      Thank you for pointing out the repetition. Later i reviewed my code and found a mistake indeed. I needed to write my code as;

      Code:
      reg mydep_var myvar1 myvar2 myvar3 i.year i.in_ij, cluster (in_ij)
      to take into account pair fixed effects. I hv around 150k observations and when i execute it, it says matsize is not enough. I changed it to 11000, but this did not solve. I dropped some of the individuals and now have around 100k obs, but Stata does not want to finish the regression with the code above (it takes few seconds with xtreg). Please, do you know any other way that i may use for the same regression and get perform Reset test?

      Regards,
      Ima



      Comment


      • #4
        Yusu:
        you may want to take a look at -areg-.
        Kind regards,
        Carlo
        (StataNow 18.5)

        Comment


        • #5
          Mr Carlo,

          Unfortunately -areg- did not work as well. At first, matsize was not enough. I dropped some obs, took tensof minutes but estimates did not finish. Many people are having over 100k observation so there should be another way to carry out Reset test. Hopefully other statalist members would suggest solution to this.

          Comment


          • #6
            Dear Ima,

            This is easy to do. Estimate the model using -xtreg-; get the fitted values using the option -xbu-; generate the powers of the fitted values; estimate the your model using the new variables (powers) as additional regressors (do not forget to use clustered standard errors); test the joint significance of the news regressors. That's it!

            In general, doing the test "manually" has two important advantages: a) we can control the number of powers to use; b) we can perform the test using a valid covariance matrix and therefore make the test "robust".

            I cannot avoid adding that I am a big fan of the RESET, all my students can confirm that

            All the best,

            Joao

            Comment


            • #7
              Mr Joao,

              Thank you for your detailed explanation. Highly appreciated.

              I executed command as bellow;
              Code:
              xtreg mydep_var myvar1 myvar2 myvar3 i.year, fe robust
              predict fit, xbu
              gen fit_2=fit^2
              xtreg mydep_var myvar1 myvar2 myvar3 i.year fit_2, fe robust
              test fit_2=0
              F( 1, 11522) = 264.30 Prob > F = 0.0000
              Could you say, is the implementation correct? And, in general, can we apply this procedure to other -xt- coomands that does not support support post estimations too?

              Best Regards,
              Ima
              Last edited by Yusu Ima; 19 Feb 2016, 23:34.

              Comment


              • #8
                Dear Ima,

                Yes, this looks correct to me.

                Indeed this procedure can be applied very generally but it is perhaps better to use it only when the time dimension is large. Alternatively, you can perform a similar test doing the prediction with the option xb (instead of xbu).

                Best regards,

                Joao

                Comment


                • #9
                  Mr Joao,

                  Thank you so much for your inputs. Thanks to your comment, i do neither need to decrease my sample size, nor wait hours long for the results to come out. Highly appreciated.

                  Best Regards,
                  Ima

                  Comment


                  • #10
                    Dear Mrs. Santos Silva,

                    I successfully applied the same approach. Can you help me in the explanation? How can I interpret the p value of 0.0000?

                    Thank you very much in advance!

                    Comment


                    • #11
                      Dear Paul Olz,

                      That means that you reject the null that the model is correctly specified.

                      Best wishes,

                      Joao

                      Comment


                      • #12
                        Dear Joao Santos Silva,

                        Thank you very much for your answer. Unfortunately, I am a little bit confused by your answer. Do you mean by this that "H0: the model is correctly specified" and this hypothesis gets rejected meaning that the model is incorrectly specified or that "H0: the model is incorrectly specified" gets rejected meaning that the model is correctly specified?

                        Thank you again very much in advance!
                        Last edited by Paul Olz; 02 Jan 2023, 07:25.

                        Comment

                        Working...
                        X