Announcement

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

  • Do-file vs Ado-files

    I am new to STATA programming and am wondering why you would save the file as ado rather than a do-file. Can you give me some examples of when you would use that over a do-file? I have been saving my programs to reproduce later and a do-file works well. Would appreciate some feedback. Thank you.

  • #2
    Ado files are usually used for programs of some generality. Basically, if you have an ado-file named myprogram.ado, you have, in effect, created a command -myprogram- that you can invoke and use just like any other Stata command. Moreover, that ado file should contain a Stata program with the name -myprogram-. That program would normally be written in very general terms: variable names, constants, and data sets to be used by it would be passed as arguments or options on the command line when the command -myprogram- is given, not named explicitly within the code. That way it can be used in many different contexts.

    By contrast, a do-file usually contains code that has a specific purpose, relates to a specific project and usually explicitly mentions by name the particular data sets and particular variables it works on.

    Comment

    Working...
    X