Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Identify all user-written commands used in a do-file

    Hi,

    I've a paper accepted at a journal and have to send my do-files for replication purposes.
    I'd like to include all the ados used in this do-file which were not pre-installed, like ivreg2 etc.

    Is there any chance to find this out?

    Best,
    Mike

  • #2
    Not sure why you would want to do that? Why not just add a note on top of your code saying I used the following user-contributed packages in the analysis: ivreg2, ...etc. The "reviewer" can then just install them all before they run your code.

    Comment


    • #3
      Originally posted by Walid Al-Soneidar View Post
      Not sure why you would want to do that? Why not just add a note on top of your code saying I used the following user-contributed packages in the analysis: ivreg2, ...etc. The "reviewer" can then just install them all before they run your code.
      This is exactly what I want but it's a long paper with many things and I don't remember which of the commands used were pre-installed and which weren't.

      Comment


      • #4
        It is rather brute-force and not very sophisticated, but see callsado from SSC.

        Comment


        • #5
          You should have a rough idea of how many commands that might be, say 3, 10, 30, 100, .... If it's few, then this is a slightly painful way of doing it but I can't think of a better way to do it (and my own method of "know what I use in Stata well enough to remember where most things I use come from" isn't easily transferable...) .

          1. Run adopath and save for later use its settings.

          2. Blank out everything except its first three settings using sysdir

          3. Change to a new directory. Copy the do-file to that directory.

          4. Run the do-file repeatedly. Each time it fails because it can't see a command code file, find and copy that file to your current directory.

          5. When done, restore your adopath settings.

          6. Now include references and acknowledgments in your paper to the authors of those files, whose work you depend on.

          7. In the next such project, apply the same principle pre-emptively by documenting each time you add a community-contributed command to your code.

          Comment

          Working...
          X