9 Learning More
You’ve now learned a great deal about how to wrangle data in Stata. However, you’ll almost certainly need to learn more. Thus we’ll conclude by discussing resources for doing so.
9.1 Help
Your first resource is the Stata help files, which are far better than most. Most of the time, you’ll find what you need more quickly in the help files than by googling.
9.1.1 Help for Commands
To see the help for a particular command type help and then the name of the command in the Command window. For example, type:
help mlogit
This will show you an abbreviated version of the documentation for the mlogit (multinomial logit) command. For the full documentation, click View complete PDF manual entry at the top. This includes:
- The Title and Description of the command.
- A Quick Start section that shows you how the command is used, which is great if you just need a refresher on the syntax
- A full Syntax diagram for the command and a list of available options. It also tells you what kinds of weights are allowed.
- A detailed description of all the Options.
- Remarks and Examples that can give you a pretty good start on both the Stata and the statistics involved in using the command.
- Methods and formulas if you need to know exactly what it’s doing.
- References you should read if you plan on using a model in your research that you’ve never formally studied.
- An Also see section—if it turns out that a command isn’t quite what you need, the chances are good that the command you actually need is listed there.
Note that every command that runs a statistical model has a separate entry for postestimation tasks, like prediction or calculating margins. You can see it with:
help mlogit postestimation
Typing help functions will give you a list of the functions you can use in mathematical expressions, while help egen will give you a list of egen functions.
9.1.2 findit
Often you’ll know what you want to do but not the name of the command that will do it. Then findit is your best bet—think of it as Google for Stata. For example, suppose you want to do something with Heckman selection models. If you type
findit heckman
you’ll get a tremendous amount of information. First Stata will search the help files and point out that there is a heckman command, along with related commands like suest and treatreg. Then it will search the Frequently Asked Questions files on Stata’s web site and the large Stata web site at UCLA. (The UCLA web site contains a great deal of useful information, but unfortunately it’s no longer being updated). Finally it will search through the user-written programs that have appeared in the Stata Journal, the old Stata Technical Bulletin, or in the Boston College Statistical Software Components archive. You can find out what these programs do by reading their help files (.hlp), and if you decide they’ll be useful to you you can download and install them by clicking on the click here to install link. See Finding and Installing User-Written Stata Programs for more information.
9.2 Effective Googling
Of course Google will be a useful tool as well. Usually you can find what you need by searching for Stata and then the command or topic of interest. If you are getting an error message, googling for that exact error message (put it in quotes) can often find discussions of the exact problem you’re facing.
9.3 SSCC Resources
The following is the SSCC’s Stata training track (see our training tracks page for other languages):
| Topic | When to take | Stata |
|---|---|---|
| Introduction/Basics | Before any other training, or before taking a class that will use the language. | Introduction to Stata |
| Data Wrangling Fundamentals | Before doing data-driven research. | Data Wrangling in Stata |
| Data Wrangling Topics | When needed for your research. | Working with Dates and Times in Stata Working with Text Data (Strings) in Stata Stata Tools for Reading Data from Web Pages |
| Tables and Data Visualization | When you start working with data. | Tables in Stata Bar Graphs in Stata |
| Tools | As soon as you decide you’ll use the language regularly. | Stata Macros and Loops |
| Analysis Tools | When you start doing analysis. | Stata Regression Fundamentals Regression Diagnostics with Stata |
You can take these as SSCC workshops (some are taught more frequently than others) or work through the material on your own. I recommend making a deliberate effort to round out your Stata skills rather than discovering you need to learn something when a deadline is looming.
The SSCC’s Knowledge Base, in particular the Stata section, includes all of the above as well as more specialized topics.
Finally, the SSCC’s statistical consultants are available to assist SSCC members. We cannot write your Stata programs for you. But we will be more than happy to help with planning your project, figuring out the commands that will make your program work, and of course fixing bugs, along with consulting on statistical methodology.
9.4 Practice
The most important resource for learning Stata is practice. If you don’t use the skills and knowledge you’ve gained from reading this series within the next few weeks (at most) you’ll lose them rapidly. If you don’t have a current research project that will require you to use Stata, make one up.
One common pitfall is “I’ll just do it in Excel.” It may be true that you can carry out a particular task in Excel faster than you can first learn how to do it in Stata and then actually carry it out. But if you do it in Stata anyway, the next time it comes up you’ll be able to do it much more quickly in Stata than in Excel, and more reproducibly, and with less likelihood of error. You’ll also build up your general Stata expertise, so that soon you’ll be able to do things faster in Stata even if you’ve never done them before. Now that you’ve spent the time to learn Stata, plan on never using Excel for analysis again.
9.5 AI
As of this writing, AI cannot be trusted as it regularly makes mistakes, though the frequency of those mistakes is steadily declining. It is best used in contexts where its mistakes are either unimportant or reliably detectable. The trouble is, code that is 99% correct will usually give you a result that is 100% wrong. If you’re lucky, the result will be an error message. Far worse is a wrong result that looks plausible.
If you ask AI to teach you how to do something in Stata, it will usually be obvious very quickly if what it’s teaching you doesn’t actually work. Just be sure to do some examples where you know the correct result, so you can verify that you get it. I would still start with a web search for a human-written explanation of whatever you need to learn. If you can find one, it will be more trustworthy. But AI can be a good resource for specific Stata questions.
If you ask Stata to teach you something about statistics, you probably won’t have any way of knowing whether what it taught you is correct or not. The more advanced the topic, the more likely it is to be wrong. I strongly recommend against asking AI for statistical advice, except perhaps as a source of ideas which you then carefully investigate and evaluate for yourself.
You can ask AI to write Stata code for you, and often it will do a good job. But you cannot trust it. You need to read the code, understand it, and ensure it is really doing what you want it to do. Sometimes this can be much faster than writing the code yourself. Sometimes. Note that AI models that were designed to write code will do a better job than general-purpose models.
I occasionally encounter young grad students who think that the advent of modern AI means they do not need to learn how to code. Perhaps that will be true someday, but it is certainly not true today. Skillful use of AI can reduce the amount of time you spend writing code. But you are responsible for all the code used in your research project. You must understand it and be sure it is correct, or you run the risk of publishing career-damaging errors. And you must learn how to code in order to do that.
Of course I’m preaching to the choir here: if you thought you didn’t need to learn how to code in Stata, you wouldn’t have read this book. Congratulations on making it to the end! I hope the skills you’ve learned will be helpful to you.