Stata Do File Craft

Writes Stata do-files that a stranger can run end to end from raw data on a different machine and get the same numbers. Enforces a master do-file calling numbered scripts, one machine-specific line and relative paths everywhere else, a version statement, timestamped logging of every run, locals inside files and globals only for paths, loops over specifications instead of copy-paste, defensive assert and isid checks, capture used only where it cannot hide an error, seeds for anything random, and an absolute ban on editing data interactively. Use this skill when someone asks for help writing or fixing a do-file, says their code will not run on a coauthor's machine, cannot reproduce a number they produced last month, has a single enormous script that has become unmanageable, is preparing code for a journal data editor, or asks how to make a Stata project reproducible. Trigger also on vaguer requests such as "clean up my Stata code", "why did my results change", or "how do I organise this".

ingridleiria Updated

File contents

ingridleiria/breaktalk-skills/tree/main/phd-research/stata-do-file-craft commit b8c1b78db5

Frequently asked questions

npx skillmds@latest add ingridleiria/stata-do-file-craft