Announcement

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

  • Hausman and goodness of fit for xtpoisson

    Hi!

    1) I'm having trouble conducting a Hausman-test for my xtpoisson, getting the respons:
    chi2(37) = (b-B)'[(V_b-V_B)^(-1)](b-B)
    = -4631.45 chi2<0 ==> model fitted on these
    data fails to meet the asymptotic
    assumptions of the Hausman test;
    see suest for a generalized test
    I've done it in the correct order eg: fe re. And as I understand it I can't use "suest" for xtpoisson? It requires predict and score which I don't find as an option for xtpoisson. I have done the hausman test with xreg instead but since I am supposed to use xtpoisson I want to make the test work with this specification.

    2) I also want to do a goodness of fit on my model, but get the respons:
    . estat gof
    subcommand estat gof is unrecognized
    r(321);
    So concluding that this does not work on xtpoisson either. Are there any equivalent tests I can use? I am concerned with overdispersion in my data since the variance is far greater then the mean. Or can I look past Thos when using fixed effects and robust SE witht he xtpoisson command?

    My dependent variabel is FDI flow and since I do not use ln it is highly skewed.
    Last edited by Emmy Lundblad; 31 May 2016, 07:21.

  • #2
    Dear Emmy,

    I do not think it is very interesting to do the Hausman test in this context for the simple reason that the random effects estimator is not that appealing. The Poisson regression you are using is based on a non-linear model and in this context the random effects estimator will have to be based on unreasonable assumptions about the distribution of the errors. So, I would just stick to the FE regression.

    The "goodness of fit" test is also inappropriate in your context. Notice that you can change the amount of overdispersion in you data simply by changing the scale in which you measure FDI (just divide everything by 1 million and wee what happens!). Therefore, unless you are really modeling count data, there is no point in doing that test.

    One thing you can do, however, it to run a RESET test; that may be informative about the adequacy of your model.

    All the best,

    Joao

    Comment


    • #3
      Thank you so much for the clarification in my case. I am going with FE, just wanted it confirmed but i guess I can look past the test as you say, in this context.

      The scale in my dependent variable is already in million USD, as are my regressors that include GDP. My model did not show much significance but antoher issue is the amount of missing values in the dependent variable (60%!) so I am tryng to 'tackle this'. Could this not be the reason for overdispersion? Or are only values, including zeros, taken into account here?

      Again it is my understaning that i can't use xtpoisson to estimate the RESET, same as with estat gof. Since I'm using paneldata, how will this affect my estimations? I did the estat gof using poisson and it showed significans. But then I could not specify fe so I'm not sure how correct the test is.

      Comment


      • #4
        Dear Emmy,

        As I said, in your context overdispersion is meaningless, so not not worry about it. The missing value is a totally different (and serious) issue; I am afraid I know no good solutions for it.

        The RESET can be done "manually" even with xtpoisson; just get the fitted values of the index, square them, and run the model with the new variable.

        All the best,

        Joao

        Comment


        • #5
          Okey! Well yes, the missing values are just a part of my data so I will just have to take that into account.

          I will try this - thank you so much for your help.

          Comment


          • #6
            I did the RESET test as described on your Log of Gravity page. As i understood it, noting xb gets only the independent variables fitted values? Did the regression again and the t-test fitted values^2=0.

            [FDIout]fit2 = 0

            chi2( 1) = 13.30
            Prob > chi2 = 0.0003

            But is it possible to test only a selection of independent variables? Meaning, doing the test on a few variables and then doing the t-test?

            Comment


            • #7
              I also did it using the ppml-command, only with year-dummies (no country-pair FE) and got:

              chi2( 1) = 0.10
              Prob > chi2 = 0.7510

              Comment


              • #8
                Dear Emma,

                Sorry, I do not think I understand your question. Anyway, are you using clustered standard errors when doing the reset?

                All the best,

                Joao

                Comment


                • #9
                  Yes I used clustered standard errors.

                  My question was, do I test the fitted values for each regressor or for the whole regression? Only writing predict x, xb generates one fitted value. I interpreted this as the index you mentioned. Should I or is it possible to generate fitted values for each variable i.e predict x1 x2 and so on.

                  I did not work when I tried it in STATA at least.

                  Best regards, Emmy


                  Comment


                  • #10
                    Dear Emmy,

                    Predicting x1, x2, etc, does not make sense; what you want to do is to get the predicted index (xb).

                    All the best,

                    Joao

                    Comment


                    • #11
                      Thank you, again !

                      Comment


                      • #12
                        Dear Professor Silva,
                        I am sorry to bother you again in this thread too, and by the way, thank you for your previous replies, but I would like to ask you a further question. I read this and other threads on statalists looking at diagnostics for xtpoisson, fe. I followed your suggestion and your codes for testing fitted values. But I did not understand how to interpret the results.
                        1. The test "test fit2" gives a chi2(1)=11.65 and prob > chi2=0.0006. Does it mean that the model is good or not?
                        2. In other thread, you suggested the code
                        Code:
                         
                         sysuse auto, clear g id=rep78 drop if id==. xtset id xtpoisson price mpg, fe predict double fitted, xb gen double yhat=exp(fitted)  egen meany=mean(price) , by(id)  egen meanyhat=mean(yhat), by(id)  gen double exp_alpha=meany/meanyhat if meanyhat>0  replace yhat=yhat*exp_alpha if meanyhat>0 su price yhat
                        In the last line you look and the dependent and the fitted value, I understood it as you want to compare them. If it is correct, should I expect DV and yhat to have similar mean and std. dev?

                        Once again thank you for your help and your patience.
                        Best regards,
                        Francesco Baraldi

                        Comment


                        • #13
                          Dear Francesco Baraldi,

                          1. Assuming that you did the test correctly, that means that the null that the model is correctly specified is rejected.
                          2. They should have the same mean, but not the same sd. Notice that the fitted values constructed with this code are not the ones you need for the test; for the test you just need the results obtained with predict with the option xb.

                          Best wishes,

                          Joao

                          Comment


                          • #14
                            1. The code I used is
                            Code:
                             
                             * Get fitted values (of the linear index, not of trade) predict fit, xb  * Square the fitted values gen fit2=fit^2
                            After running xtpoisson, fe. Is this correct?

                            2. the mean of the DV and yhat are respectively .3616071 and .3890374, while the sd are .6877315 for DV and .5546896.
                            So, if I understood correctly my model is not correctly specified, isn't it?

                            Comment


                            • #15
                              Dear Francesco Baraldi,

                              The command is correct and you reject the null that the model is correctly specified; it is not the same thing as accepting the model is misspecified.

                              The fitted values generally have lower sd but should have exactly the same mean. Make sure you are doing the comparison for the same sub-samples (i.e., make sure you are dealing with missing observations).

                              Best wishes,

                              Joao

                              Comment

                              Working...
                              X