Eric Lenz
Eric Lenz
  • 8
  • 38 508
Make a Wordcloud in Python...part 2!! Fredclouds!!
In this video I make a Fredcloud...two Wordclouds scraped from several FOMC press releases imposed on a Fred graph of the federal funds rate. I also process some images in Gimp to make masks for the Wordcloud. We see that the Fed has a greater variety of interests post-Covid relative to pre-Covid.
fredcloud.py: docs.google.com/document/d/1BjHBPJc4JmutXvT6pHqqCR60vpKdAHAE-enCvXKlhMQ/edit?usp=sharing
fredcloud.png: drive.google.com/file/d/1MI9TUotWW-sPIV8Iv1fGHOKxWanPX2vx/view?usp=sharing
Fred.png: drive.google.com/file/d/1-6ZlmRXDrgpRPxV6kXAUNN6b5RQyqeTr/view?usp=sharing
Fred_0.png: drive.google.com/file/d/1rzTIuidsTjWfLtVu6tCVNOzkKRl-y0uQ/view?usp=sharing
Fred_1.png: drive.google.com/file/d/14GWbmCjR-vX7dbIxtU39vYIor59PYMit/view?usp=sharing
Fredtrans.png: drive.google.com/file/d/1JvC_pVPH72L_hdNCIxJE35hj_tkXqEFE/view?usp=sharing
00:00 Introduction
01:36 Packages/modules
02:00 FOMC url lists
03:48 For loops
06:14 NLP
06:55 Gimp/FRED graph
08:00 first Mask
09:33 Feather
10:27 Export as .png
10:59 second Mask
11:30 Crop
12:46 Transparency/alpha channel
14:30 numpy
15:17 contour_color
16:10 Wordclouds/paste
18:08 Transparency paste
18:58 Fredcloud
#naturallanguageprocessing #wordcloud #webscraping #gimp #python #fred
Переглядів: 45

Відео

Make a Wordcloud in Python!
Переглядів 58День тому
I show how to make a Wordcloud in Python using web-scraping and natural language processing techniques. We look at a Federal Open Market Committee (FOMC) press release which highlights the Fed's focus and goals for monetary policy. I also show that the Fed cares a little more about communicating risks post-pandemic. wordcloudyt text file: docs.google.com/document/d/11o8Z2zJgVZkGQv_ZsgLVq5qAgZNS...
Teaching and research update - Fall 2021
Переглядів 1763 роки тому
Teaching and research update - Fall 2021
Estimate confidence and forecast intervals in Stata
Переглядів 3,5 тис.3 роки тому
Is 6% GDP growth likely for the United States in 2021? I estimate confidence and forecast intervals in Stata to show that 6% growth or more would be an outlier. I discuss recent growth forecasts, characteristics of the normal distribution, the theory and interpretation of a confidence interval, and finally I estimate confidence and forecast intervals in Stata. Myron Scholes presented online at ...
Forecast GDP growth in Stata
Переглядів 16 тис.3 роки тому
Learn how to forecast in Stata with two examples of GDP growth. First, I forecast U.S. real GDP growth into 2025 to determine how quickly the U.S. economy may recover from the pandemic. Then, I forecast world real GDP growth into 2025 and after the global financial crisis. Finally, I compare my forecast with IMF forecasts after the global crisis. Program code and data: drive.google.com/file/d/1...
Create maps in Stata with spmap
Переглядів 18 тис.3 роки тому
How can you create nice maps in Stata? Kevin Crow and William Gould at StataCorp write a nice walkthrough for the spmap command. I follow their basic outline using income per person and county coordinate data. Then I show how to customize the color palette, change the legend, and display z-scores. The data is from the IRS Statistics of Income (SOI) and American Community Survey (ACS) Migration ...
Create attendance grades using Zoom reports in Stata
Переглядів 2143 роки тому
Zoom records meetings and participant information. The participant information includes names, email addresses, dates and times, and the participant's duration in the meeting. I use the duration in each meeting to create an attendance grade in Stata. Program file in .txt format: drive.google.com/file/d/1rdD5X3lzqGeCruX4nnCBAAKdq_NOfYRZ/view Check out my website for more information: sites.googl...
Simple linear regression model
Переглядів 2594 роки тому
An easy-to-follow example of a simple linear regression model with one explanatory variable and five observations in open source spreadsheet software. See how the estimation of Y changes with new inputs of X. Also, see how the parameters of the regression equation change with different values of X and Y. Check out my Economics Blog at sites.google.com/view/lenz. Thank you for visiting!

КОМЕНТАРІ

  • @user-yz9bu6rx7b
    @user-yz9bu6rx7b 2 місяці тому

    What data are you using to predict GDP growth?

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

      I keep replying to this...it's shown in the video and linked in the description. The same data as the authors of the plot!

  • @user-yz9bu6rx7b
    @user-yz9bu6rx7b 2 місяці тому

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

    • @econ_eric
      @econ_eric 2 місяці тому

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

  • @user-yz9bu6rx7b
    @user-yz9bu6rx7b 2 місяці тому

    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 2 місяці тому

      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 2 місяці тому

      @@econ_eric what IMF data is that specifically?

    • @econ_eric
      @econ_eric 2 місяці тому

      @@user-yz9bu6rx7b Check out 9:39.

    • @econ_eric
      @econ_eric 2 місяці тому

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

  • @KarlaRamirez-g5w
    @KarlaRamirez-g5w 4 місяці тому

    Thank you so much, Eric! I will put you on my acknowledgments & references for my poster presentation! Once again thank you!

    • @econ_eric
      @econ_eric 4 місяці тому

      You're welcome! Thank you!

  • @pedrov.piffaut6585
    @pedrov.piffaut6585 4 місяці тому

    Excellent video, thank you!

    • @econ_eric
      @econ_eric 4 місяці тому

      You're welcome!

  • @erkimula2002
    @erkimula2002 6 місяців тому

    Thank you, Eric.

    • @econ_eric
      @econ_eric 6 місяців тому

      You're welcome!

  • @desperatewanderer742
    @desperatewanderer742 8 місяців тому

    This is awesome - thank you so much

    • @econ_eric
      @econ_eric 8 місяців тому

      You're welcome!

  • @arisraz
    @arisraz 9 місяців тому

    Thanks for this! Really helped my research!

    • @econ_eric
      @econ_eric 9 місяців тому

      You're welcome!

  • @zeliesieyadjeu8096
    @zeliesieyadjeu8096 11 місяців тому

    Thank you so much it helped a lot. Can you please tell me how to add a North arrow and the scale?

    • @econ_eric
      @econ_eric 11 місяців тому

      That's a great question! I assume you mean a distance scale..I'm actually not familiar with adding these elements, but you may find some help at the Stata forums or simply through internet searches. Thanks!

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

    Thank you so much! I was struggling with the state borders but finally made it thanks to you!

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

      Excellent news! I'm glad you got it. I find youtube to be a great resource for programming, so easy to see examples worked out.

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

    Hi! Very helpful, thank you. Do you know what options must I specify to color the map as a heatmap? Thank you

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

      Hey Emily, check out this website for the different color palettes: repec.sowi.unibe.ch/stata/palettes/colors.html. The author gives you the code and examples. You can do a search for "heat" or just pick out the scheme that you think looks best. Thanks!

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

    Hello Eric. I just realized while watching the video that I have known you since my graduate school days. :) Hope you are doing good.

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

      Haha, I knew that might happen when I posted this. I hope you are well!

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

    Thank you very much. I have one concern, how do I put the labels on the regions or cities? I am viewing data on the map of Benin, and I need to put the names of the departments and communes on the map.

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

      Hello Duhamel, you're welcome. I'm not certain that the spmap command has this functionality, but if you send me the files and code, then I can take a look at it. Alternatively, you can search online for more documentation and there is a forum where you can post the question for others: statalist.org. Thanks!

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

      @@econ_eric Hello, thank you for your answer. I got the solution to my problem and I was able to put the names of the departments on the map.

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

      Another concern of mine is to be able to visualise more than one variable at a time on the map with legends of each variable.

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

    Thank you very much ❤❤❤

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

    Thank you so much Eric, your video really helped me

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

    What an insightful video, thanks Eric!

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

    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.

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

    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 Рік тому

      @@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.

  • @patriciamawuledeyagyapong2739

    Thank you. This was extremely helpful

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

      Of course, you're welcome, Patricia!

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

    Excellent and amazing. Thank you Eric.

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

      Of course! You're welcome!

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

    This is amazing job. Thanks a million Eric

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

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

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

      Glad it was helpful!

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

    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 2 роки тому

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

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

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

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

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

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

      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!

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

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

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

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

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

      @@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 2 роки тому

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

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

    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 2 роки тому

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

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

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

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

    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.

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

    Hi Eric, thanks very much for the video. Unfortunately when I follow all of your steps I am met with the following error: Variable id specified in option id() does not uniquely identify the observations Any suggestions on what I may be doing wrong would be a great help. Thanks

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

      Hi dougie ws, did you perhaps make a change to the data? This program should work since I uploaded it to the Google drive. I would try to download and run again. Let me know if that works.

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

    I really appreciate you for sharing this tutorial video. It is great

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

      You are very welcome, Ali.

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

    Amazing video and shared content. Thank you so much.

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

      Glad it was helpful!

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

    Very well explained Professor! Thank you for this

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

      Thank you, Zaeem, you are welcome!

  • @15khari
    @15khari 3 роки тому

    Thank you!

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

    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 роки тому

      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 <0.05. It is true that the relationship may be spurious; however, the theoretical justification is not a stretch. Also, this model is probably sensitive to the selection of the sample. For instance, if we drop a recent outlier in GDP growth, the q-value and p-value may change.

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

      @@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 :)

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

    Eric, you are amazing. Hope you can do more videos about Stata

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

      Thank you, Chris, I have some more to come.

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

    Thank you! Very helpful.

  • @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.

  • @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.

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

    Great contribution to the university community that we make use of this type of analysis, greetings from Ecuador

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

      Thank you, Giovanni!

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

    Thank you very much for this great brief lecture. Please kind share your codes with me. Secondly, how do i go about Covariate Augmented Dickey Full test?

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

      Hello! The link to my program code and data is in the description - thank you!

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

      @@econ_eric Hi Eric, thank you very much. Any idea about Covariate Augmented Dickey Full test? Thanks.

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

      @@businessleadershipandmanag522 I've done a quick search and found a good post in the Stata forums by Andrew Musau: www.statalist.org/forums/forum/general-stata-discussion/general/1361250-determining-optional-lag-length-using-varsoc-for-panel-data According to Andrew in 2016, the topic isn't addressed well in the Stata forums. However, there have been some updates to Stata since 2016 and maybe they address it in Stata 17. You could also try contacting some of the Stata staff.

    • @MAX-ho6wg
      @MAX-ho6wg Рік тому

      @@econ_eric Thanks Eric.

    • @MAX-ho6wg
      @MAX-ho6wg Рік тому

      @@econ_eric Im using Stata 15.

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

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

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

      Thank you, Hermanus!

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

    Great, informative, professional work. Well done 👍🏻

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

      Thank you, Lord of Fraternity!

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

    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!

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

    Very nice, Eric! Thank you for sharing this public good with us!

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

      Glad you enjoyed it!

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

    Thank you so much! This is really helpful.