Friday, December 18, 2020

Stata Tip: How to Clean String Variables

I know, I know. It's been a while since you've heard from me. You know how some people have been super productive during the pandemic? I haven't been one of them. Oh well. The good news is that I survived teaching my first all-online semester. I submitted grades yesterday! To all of the students who attended the classes live this semester..and especially to those of you who put your camera on every now and then, thank you! To those of you couldn't, do stop by my office sometime when we're back on campus to say hello.  ;) 

And now, to get things restarted on this blog, I thought we'd go with a Stata tip on how to clean string variables. Sure, sometimes we are given nice, ready to go data. Other times, not so much. For example, imagine that sometimes "Delia Furtado" appears as "Delia furtado" or "delia   furtado" or "Delia%&Furtado".  What to do? See Verena Wiedemann's Stata tricks, posted on Oxford's Coders' Corner (h/t David Mackenzie's blog). 

Yes, you could try to find these "by hand," but the more you do automatically, the less likely you are to make mistakes! 

Sunday, October 25, 2020

Cool Data Alert: Historical Data

I haven't done any work using historical data, but I must say I am intrigued! This IZA paper describes some of the most commonly used  data sources (well, by economists). They are broadly classified as geographical data, ethnographic data (really cool!!!) and Censuses. For each group, the authors "outline the issues they raise and also point out which methodological advances allow economists to overcome or minimize these problems." 

If you're a history buff and you're looking for a dissertation topic, take a peek. 

Thursday, October 15, 2020

Stata Tip: Quick and Easy Code for Making Plots

Yes, I've said this. A picture is worth a thousand words. Or in our case, a picture is worth a thousand numbers in a table. The DIME folks at the World Bank have just put together a super useful resource on how to quickly code all of the different types of plots you may want to make. Click on the you plot you want to make and up comes the code that is used to make it! No need to to spend hours googling how to do this for each potential plot. What an amazing public good! 



P.S.I put the the pictures up just to make my blog pretty. To get the actual code, click on the link above. Or here. 

Saturday, October 10, 2020

10 Commandments for How to Give a Seminar

Kjetil Storesletten gave a talk with the commandments for giving a seminar--maybe specifically a job talk. You can see the slides here and watch the talk here. 

Stating the question you are asking very clearly and at the beginning of the talk is so important (Commandment 2). Yes, this is of course always important but maybe especially important during an economics talk so that you don't keep getting interrupted with questions that are not really relevant to the question you are trying to answer. The fewer of those "out there" questions you get, the more likely you will be to have well prepared answers to the questions (see Commandment 10). 

I would also emphasize Commandment 4: Show the value-added of your paper. Sometimes newbies want to 'over-emphasize' their work by 'de-emphasizing' prior related work. This is not only dishonest, but you may find yourself fighting unnecessary battles. For example, if some well-respected economist has already used your identification strategy to study some other outcome and that paper is now published in a solid journal, then your audience may not make you work as hard to defend that broad identification strategy. Instead, they will focus their questions on why it may (or may not) be appropriate for your particular application. This is probably a much easier battle to fight and it is the battle you should be prepared for. 

Good luck! 

Thursday, October 8, 2020

Stata Tip: Best Advice on Writing Dofiles

Yes, I know you're excited to see the results of your regression. Go ahead and be sloppy with your coding. You probably will make mistakes. You'll go back to fix them. Maybe that's fine. But at some point, go through these J-Pal instructions and guidelines on how to clean your data. The big rules: 

  1. Document decisions
  2. Never overwrite the original/raw data file
Other gems include: Look at the distribution of every variable you use in your analysis (do you have 500 year olds? Are the missing values set to 99?) Do you see anything suspicious? The more you know about the data, the better. 

Also, use Stata's help command to learn more about "mvdecode" and "subinstr."  And remember to rename variables so that you can tell what they are by looking at the variable (hint: a dummy variable called "male" is more helpful than one called "sex"). Label the values so that you don't have to keep going back to the codebook. 

Tuesday, October 6, 2020

Message to My Students

I just saw this on twitter, and it is absolutely true. I forget to say it, I know, but I am very often very impressed with your work. So impressed that I want to help make it as great as it can possibly be. Please do keep sending me your paper drafts. Do the best job that you can. Fix the typos you catch, and remember to include a date and page numbers. But remember that I don't expect perfection in your drafts. After all, they are drafts. 


Friday, September 25, 2020

On Nonacademic Jobs

 Yes, I know that most of you decided to get a PhD specifically because you had an academic career in mind. But keep in mind that while you were all exposed to academic careers to some degree while in college, you might not know about the many fulfilling jobs you might have (with that PhD in hand) in the private sector, government sector, etc. I will not tell you which is best for you, but I will tell you to seriously consider all of these options when sending out applications. Read about what everyday life looks like in the different types of jobs. Think about how to prepare for the job market if you're particularly excited about a nonacademic career.  

In this morning's blog entry, David Mackenzie points us to many different and useful resources focusing on jobs for development economists. Have a look here.