Skip to content

Common errors and common solutions

Alexandersax edited this page Aug 29, 2012 · 1 revision

Bugs are an inevitable part of programming. Here are some common errors in stata, and the culprits that cause them.

###Errors that only occur sometimes If an doesn't occur every time, theres a good chance sort is to blame. When you sort data, the observations sort according to the variables you specify, but within consistent values of those variables, the observations are in random order. Your function probably relies on that order, and works when the observations are in the proper order then fails when they aren't.

###No observations You tried to run an analysis function (`mean table tab regress etc') on a subset of the datum but for some reason there are no observations in that subset. If you split the kids on grade, maybe second graders didn't take that test. Maybe there were no third graders in the Final study? Check this type of thing.