help wfdo_debug: Steps for debugging a do-file

When all else fails...

Step 1: Update Stata and user written programs (see update
and adoupdate).

Step 2: Start with a clean slate: run clear all and
macro drop _all; restart Stata; reboot your computer; and even
try using another computer.

Step 3: Try your program with a different dataset and with different variables. If the problem
disappears, it is probably caused by the specific variables or dataset you are using.

Step 4: Assume everything could be wrong. Double check parts of the do-file that you
are sure are right.

Step 5: Run the program in steps by using /* */ to exclude parts of the do-file.

Step 6: Start over: throw out all of the original code; create a new do-file with a different name;
try alternative approaches to obtain the same analyses.

Step 7: Ask for help (see wfdo_help).

Also see

WF-do-files; Workflow