Forecast GDP growth in Stata

Поділитися
Вставка
  • Опубліковано 14 жов 2024

КОМЕНТАРІ •

  • @IthielEgambaram
    @IthielEgambaram Рік тому +2

    What an insightful video, thanks Eric!

  • @indi2363
    @indi2363 2 роки тому +1

    Hi Eric, thanks so much for this video, quite informative and well explained. Greetings from chile

  • @pedrov.piffaut6585
    @pedrov.piffaut6585 3 місяці тому +1

    Excellent video, thank you!

  • @jonahanb
    @jonahanb 3 роки тому +2

    Eric, thank you so much for making this video & providing so many additional links! I felt super lost regarding a class project of forecasting for which I have 6 days to complete without any prior knowledge of how to write forecasting code, but you give me hope! :)

    • @econ_eric
      @econ_eric  3 роки тому

      You're welcome, Johanna! I'm glad you've found it useful!

  • @thinhvohuynhhung2401
    @thinhvohuynhhung2401 2 роки тому +1

    Hi Eric, it was so amazing. Thanks so much for the video.
    I just wonder which method you were using to process this forecast. Was that ARIMA?

    • @econ_eric
      @econ_eric  Рік тому

      Yes! It was a simple autoregressive model without any error terms. Thanks!

  • @georgegt4915
    @georgegt4915 2 роки тому +1

    This is amazing job. Thanks a million Eric

  • @mahatmaalimibrahim6631
    @mahatmaalimibrahim6631 Рік тому +1

    Excellent and amazing. Thank you Eric.

    • @econ_eric
      @econ_eric  Рік тому

      Of course! You're welcome!

  • @fatematuzzahra944
    @fatematuzzahra944 2 роки тому +1

    Hi Eric, many thanks, really beneficial, much appreciated.

  • @lordoffraternity
    @lordoffraternity 3 роки тому +1

    Great, informative, professional work. Well done 👍🏻

    • @econ_eric
      @econ_eric  3 роки тому

      Thank you, Lord of Fraternity!

  • @zaeemalehsaan559
    @zaeemalehsaan559 3 роки тому +1

    Very well explained Professor! Thank you for this

    • @econ_eric
      @econ_eric  3 роки тому

      Thank you, Zaeem, you are welcome!

  • @passenger8683
    @passenger8683 2 роки тому +1

    Thank you so much Eric for your essential presentation about how to forecast GDP. In the meantime, I kindly ask that could you share your do-file if it is possible?

    • @econ_eric
      @econ_eric  Рік тому

      Yes, it is in the description of the video. Thanks!

  • @woblogs2941
    @woblogs2941 Рік тому

    Thank you so much Eric, your video really helped me

  • @yuqingwu1011
    @yuqingwu1011 Рік тому +1

    hi Eric, thanks for your video, it helps! Only one question, is the squared deviation referring to variance?

    • @econ_eric
      @econ_eric  Рік тому

      You're welcome, Yuqing! Do I refer to squared deviation in the video or the program code? I'm not quite sure what you're referring to.

    • @yuqingwu1011
      @yuqingwu1011 Рік тому +1

      @@econ_eric hi Eric, you mentioned squared deviation from mean in the video and say there is much deviation from mean corresponding to the crisis, I am not sure if the squared deviation here referring to the variance

    • @econ_eric
      @econ_eric  Рік тому

      @@yuqingwu1011 I'm not sure where I said squared deviation in the video, but the GDP growth associated with a crisis will be a large deviation from the mean of the GDP growth series.

  • @hermanusbernardusswart4690
    @hermanusbernardusswart4690 3 роки тому +1

    Very well done! Thank you so much!!! :)

  • @luzhang9763
    @luzhang9763 3 роки тому +1

    Thank you so much! This is really helpful.

  • @Beygent
    @Beygent 2 роки тому +1

    I really enjoyed the video! Can you do something on how to calculate beta convergence? Thanks.

    • @econ_eric
      @econ_eric  Рік тому +1

      Interesting! I'm not too familiar with these empirical models, but I'll consider it for a future video!

    • @Beygent
      @Beygent Рік тому +1

      @@econ_eric that would be awesome, although I hope to beat you to it 😅😅. I couldn’t find any youtube videos, so I’ve decided to take the plunge myself

    • @econ_eric
      @econ_eric  Рік тому +1

      @@Beygent Good for you! Maybe we can collaborate for a video. Let me know how it turns out! :)

  • @MrAnimefan1234561
    @MrAnimefan1234561 3 роки тому +1

    Hi Eric amazing work here..! I like to ask regarding the lag aspect. As i run through your code, i realized that the Q-value is not less than 0.05, and also the regression output for p-value as well. Just like to ask if it would be still meaningful to regress gdp growth to l.gdp growth? As im guessing the whole idea pins upon the lagged aspect. Thanks!

    • @econ_eric
      @econ_eric  3 роки тому +1

      Yes! It is still meaningful to regress gdp growth on l.gdp growth if it produces accurate forecasts. I would argue that the relationship is not spurious - a good year of growth is likely to spur another good year. Consider the alternatives and determine which model produces more accurate forecasts.
      I was thinking about making another video about lag specification or checking the accuracy of forecasts. There are several ways to check the accuracy of your forecasts - one easy way is to compare the actual data to the forecast. The Stata manual for the forecast command explains this well beginning on page 6: www.stata.com/manuals13/tsforecast.pdf
      If the coefficient on the lag of GDP growth is not significantly different from zero with 0.05 level of significance, we can try another model with only the regression constant or perhaps another variable or two. Then, plot and compare the forecasts between models, compare r-squared values, etc.
      In any case, if a model accurately forecasts, then it is hard to argue that it is not meaningful because a p-value for a coefficient is 0.054 rather than

    • @MrAnimefan1234561
      @MrAnimefan1234561 3 роки тому +1

      @@econ_eric thanks for the comprehensive comment! A lot to digest and yes a video regarding lag specification and forecasting accuracy sound like good content! Thanks for the reply :)

  • @user-yz9bu6rx7b
    @user-yz9bu6rx7b 22 дні тому

    So are you saying you are using variables and calculations to determine GDP growth?

    • @econ_eric
      @econ_eric  22 дні тому

      Yep, the GDP growth variable's historical values and calculations to forecast it's future values.

  • @yuqingwu1011
    @yuqingwu1011 Рік тому +1

    Hi Eric, another question , If the variable is not stationary, but after first difference the dfuller shows it is stationary, and then the best lag is lag 2, what should the reg command be? (The original variable is x, after first difference it is x1, and dfuller shows the optimal lag for x1 is lag2) , really confusing about this…

    • @econ_eric
      @econ_eric  Рік тому

      If you dfuller shows stationarity (reject Ho), then however you set up the dfuller test should be your base model. Then you adjust things. Check out p.2 of the tsdfuller pdf.
      If you're trying to determine which model is the best model to forecast with, then I would generate a new dependent variable series, delete some of the most recent observations, and forecast with each model. Some models may forecast a recovery from recession better and others will forecast the growth before a downturn better. Which is more important to you?
      There are also the indicators of model fit to consider. Also, I'm not sure if you mean the optimal lag # or the optimal lag. Check out the tsdfuller pdf for details on the output of dfuller and what you're actually testing.

    • @econ_eric
      @econ_eric  Рік тому

      Also, you can test whether a model is stationary by predicting residuals (postestimation in Stata). Predict the residuals and then use dfuller to determine if the residuals are stationary. Do this for each variation of your model.
      Also, If you find that the first difference of your variable is stationary, then try including a one-period lag of the variable on the right side of the equation (as an independent variable). Predict the residuals and determine if they are stationary. This can be a viable alternative to using your first difference model from dfuller as your main model.

  • @phidelischerotich7503
    @phidelischerotich7503 2 роки тому +2

    Have tried making forecasts but am getting an error that year 2022 evaluates to missing, any help please?

    • @econ_eric
      @econ_eric  Рік тому

      You may not have saved coefficient estimates from the regression model.

    • @zainabrauf1543
      @zainabrauf1543 10 місяців тому

      Same issue here. I saved the coefficient estimate from regression model. But the error still states "Missing values were encountered while attempting to solve the model at time 2023. Variable NUTHIV evaluates to missing." What might I be doing wrong? Thank you beforehand!

  • @samiasamssoume4752
    @samiasamssoume4752 3 роки тому

    Thanks for the usiful video. Please could you give me the code for the graph that figures in the second 0.04, but with panel data

    • @econ_eric
      @econ_eric  3 роки тому

      Hello Samia, you're welcome. However, I don't understand what you're asking with "the second 0.04". There is no panel data here.

    • @samiasamssoume4752
      @samiasamssoume4752 3 роки тому

      @@econ_eric Yes I know there is no panel data in your video. I ask if you have the command to do this graph that figures in your video at the second 0.04 and also at the time 8.48 minute (forcasting graph) but with panel data case. I need to get this graph for my paper using panel data approach.

    • @samiasamssoume4752
      @samiasamssoume4752 3 роки тому

      @@econ_eric I must to do a panel GMM forcasting study that's why.

  • @user-yz9bu6rx7b
    @user-yz9bu6rx7b 22 дні тому

    What data are you using to predict GDP growth?

  • @samiasamssoume4752
    @samiasamssoume4752 3 роки тому

    Please, how to get the graph of "twoway (line realgdpgrowth year) (line f_realgdpgrowth year, lpattern(dash))" but in the case of panel?

    • @econ_eric
      @econ_eric  3 роки тому

      Samia, what is your panel variable? If it identifies countries, then do you want real GDP growth plotted for each country in your data set? The variable f_realgdpgrowth includes a forecast of GDP growth, also. Therefore, many options are possible for an estimation and plot.

  • @user-yz9bu6rx7b
    @user-yz9bu6rx7b 22 дні тому

    So you made your video 6 years after the IMF projections and your model matches theirs and youre askin why their model is off in prediction. Doesnt that mean your model is wrong to if it follows the IMF projections?

    • @econ_eric
      @econ_eric  22 дні тому

      No, I used the same data as the IMF and my model more closely matches the actual growth. My model is also very simple and illustrates the concept of reversion to the mean.

    • @user-yz9bu6rx7b
      @user-yz9bu6rx7b 19 днів тому

      @@econ_eric what IMF data is that specifically?

    • @econ_eric
      @econ_eric  19 днів тому

      @@user-yz9bu6rx7b Check out 9:39.

    • @econ_eric
      @econ_eric  11 днів тому

      @@user-yz9bu6rx7b Please watch the video. I visit the actual website for data. I've also linked my data in the description.

  • @hoangduongvu
    @hoangduongvu 2 роки тому +1

    Hi Eric, thank you for your video. I go through your do file and it looks like "forecast solve" only works when the model is "reg realgdpgrowth l.realgdpgrowth". If we want to add more independent variables there (for example reg realgdpgrowth l.realgdpgrowth worldgdpgrowth), then how can we have the out of sample forecast? I tried your do-file but it does not work. Can you please help me ?

    • @econ_eric
      @econ_eric  2 роки тому

      Hello Duong, thank you for your comment. I think your solution is to store the estimates from the new model with worldgdpgrowth and then use the forecast command. For instance, include worldgdpgrowth in the model on line 79, store the estimates, and then create a new forecast model on line 96 (call it something different than ericmodel). Please let me know if that works.