Announcement

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

  • #61
    Dear John Nilsson,

    Please see my reply to your other post.

    Best wishes,

    Joao

    Comment


    • #62
      Dear Joao
      May I ask you how xtpoisson model is the same as ppml with pair fixed model??

      xtpoisson is poisson model, right??


      thank you !!!!!

      Comment


      • #63
        Yes, xtpoisson is Poisson with fixed effects, so, if you include fixed effects in ppml you get the same results.

        Best wishes,

        Joao

        Comment


        • #64
          thank you Joao!

          I want to use ppml but I cant add fixed effect cause data is too big
          instead i used ppml_panel_sg , however, variables are dropped because of collinearity with time-varying fixed effect

          I wonder if I can only use country-pair fixed effect with xtpoisson, and it is still meaningful result


          thank you!

          Comment


          • #65
            Only you can know what fixed effects to include in your model.

            Best wishes,

            Joao

            Comment


            • #66
              Dear @Joao Santos Silva,
              I am sorry to disturb you again. This time I would like to ask you a question about the handling of missing values in the year of the trade in the specific service sector. I recently searched the OECD's TiSP database for 64 exporting countries and 63 importing countries,almost 3185 countrypairs . The bilateral trade in the financial services industry in 2010-2017 .and i found that the data missing is more serious. Can I replace the missing value with 0? If this is not a scientific approach, how should I deal with a large number of missing services department data?
              Click image for larger version

Name:	2D{J0RB~MV)UC3G$R5D~D$H.jpg
Views:	2
Size:	86.2 KB
ID:	1497505

              Comment


              • #67
                Dear@ Joao Santos Silva,
                I am sorry to disturb you again. This time I would like to ask you a question about the handling of missing values in the year of the trade in the specific service sector. I recently found 64 export countries and 63 import countries in the OECD TiSP database,almost 3185 country-pairs in the financial services industry in 2010-2017. and i found that the data is missing more serious,open in the table is an ellipsis, as shown in the picture. can I use 0 instead of missing values? If it is not a scientific approach, how should I deal with a large number of missing services instrudry data?
                Click image for larger version

Name:	2D{J0RB~MV)UC3G$R5D~D$H.jpg
Views:	2
Size:	86.2 KB
ID:	1497507

                I would really appreciate your input!

                Thanks in advance,
                Alice

                Comment


                • #68
                  Dear John Alice

                  I am afraid I do not know the data well enough to be able to answer your question. If the missing values mean that the values is too small to report, replacing it with zero is likely to be OK.

                  Best wishes,

                  Joao

                  Comment


                  • #69
                    Originally posted by OA Stata View Post
                    Dear Joao,

                    Thanks a million for that. I checked and I've made the code below for the prediction (the estimation is as per comment #18 in this thread)

                    Code:
                    predict fitted,xb
                    xi:gen yhat = exp(fitted)
                    egen meany = mean(migra) if yhat !=., by(countrypair)
                    egen meanyhat=mean(yhat), by(countrypair)
                    gen exp_alpha=meany/meanyhat
                    replace yhat = yhat*exp_alpha
                    Does this look fine to you? Taking a quick look, the forecasts for the projection horizon seem reasonable.

                    Ainhoa
                    Dear Joao,

                    I have a question in relation to my model on world bilateral migration flows, estimated through PPML (in specific, -xtpqml-). I'm estimatingmigration flows as a function of the log of migration stocks (lagged), and a number of economic, demographic variables, as well as country-pair fixed effects. Based on this, the idea is to forecast the evolution of migration flows for the coming years.

                    I've done it as per the code above (which you seemed to be happy with), and I now have a doubt. I've encountered cases where "meany" above is negative, meaning that migration flows for the observed period were, on average, negative...but given the specification of my model, meanyhat will always be positive, since it's an exponential model. Hence, I get negative "exp_alpha" in those cases, making my prediction of flows very negative to the point that it loses dynamism (i.e., because my model is flows as a function of lagged stocks, if I have negative flows in t, this might give rise to negative stocks in t+1, hence stopping the forecasting process for that specific pair of country).

                    Would you have any suggestions on how to fix this please? Thanks a lot,

                    Ainhoa
                    Last edited by Ainhoa Oses; 12 Aug 2019, 09:36.

                    Comment


                    • #70
                      Dear Joao,

                      I'd extremely appreciate your feedback in my previous post #69, please.

                      Your help is really valuable to my work. Many thanks,

                      Ainhoa

                      Comment


                      • #71
                        Dear OA Stata,

                        I am not sure if I understand the question, but here are some comments.

                        a) For the exponential model to be valid, we need the conditional mean to be positive, but it is OK for the dependent variable to have some negative values. So, negative values of migration are not incompatible with the exponential model.
                        b) The stock will never become negative, right?
                        c) If I understand correctly, you are modelling net migration; I think it would be preferable to model immigration as that can never be negative.

                        Best wishes,

                        Joao

                        Comment


                        • #72
                          Thanks for that Joao, I really appreciate it.

                          Starting from c), I want to model net migration flows (not stocks), as this is the most standard approach for these types of migration models as far as I'm aware.
                          In terms of a), that's not really a problem since my independent variable is the lagged log of stocks, which is always positive.

                          I'll try to re-phrase the doubt, hope this is clearer. The simplified model is as below (for simplicity, I've dropped some other variables that I included but that are not relevant to my doubt)

                          HTML Code:
                           xtpqml migrafl loglag_migrastocks   if migrastocks>migrastocks[_n-1],fe i(countrypair)  irr
                          A shortcoming of this specification is, of course, the need to impose that migrastocks>migrastocks[_n-1], as you point out. Once I estimate the model for the historical years (a model that seems fine in terms of the estimation etc), I want to predict future migration flows. In order to predict, I want to recover the country-pair fixed effects as per the code I quoted in #69. And that's when the problem emerges, since the estimated migration flows are always positive, while the actual ones might not, hence giving fixed effects (exp_alpha) that are not really sensible.

                          Thanks again,

                          Ainhoa




                          Comment


                          • #73
                            Dear OA Stata,

                            I am still not convinced that I fully understand your problem, but here are further comments:

                            a) If meany is negative, the exponential model is unlikely to be a sensible choice (see a) above);
                            b) How many years of data do you have? Keep in mind that the estimates of the fixed effects need large T;
                            c) As usual, double check your data and your code...

                            Best wishes,

                            Joao

                            Comment


                            • #74
                              Dear Joao,

                              Thanks for that. Concerning a), when I say meany is negative, I mean the specific meany for the country of origin I'm interested in is negative (as a reminder this is a bilateral, world migration flows model). In particular, only 20% of the observations have negative flows. So the issue is that the specific country I'm interested in has a negative meany, and hence exp_alpha (the fixed effect) is negative and the projections become really negative.Separately, I can only run the regression when I impose that my dependent variable is positive, otherwise I get an error saying "migrafl must be greater than or equal to zero".

                              Would you have any suggestions as to what to do in those cases please?

                              Ainhoa
                              Last edited by Ainhoa Oses; 14 Aug 2019, 09:55.

                              Comment


                              • #75
                                Dear OA Stata,

                                Estimating the model just with the positives is certainly not a good idea. Poisson regression may not be adequate in your case.

                                Best wishes,

                                Joao

                                Comment

                                Working...
                                X