You are not logged in. You can browse but not post. Login or Register by clicking 'Login or Register' at the top-right of this page. For more information on Statalist, see the FAQ.
I have developed a do file using Stata 16.1 which consists of several functions and commands. I am trying to figure out what earlier versions of Stata can run my entire do file. Thanks for your help!
Best,
Nader
The only way to know for sure is to either get your hands on an earlier copy of Stata to test it, or it’s documentation.
Edit to add: I suppose you could gradually decrement the version number when you set the -version- at the top of your script to see when the program breaks. I would still feel better using an earlier version.
Decrementing the version number is not a test here, as setting
Code:
version 13
for example will not itself cause Stata 16.1 to ignore all extras introduced within Stata 13, or in Stata 14, 15, 16, or 16.1 (as updated by the OP).
Nor will it restore bugs that were fixed in those versions.
What version does is what help version documents, which is less.
See also https://www.stata.com/support/faqs/p...stata-version/ To be fair, when after some questions on Statalist,I first drafted that FAQ I expected it to be much shorter than it is, but realised in writing it that there are several subtleties -- but none is surprising when you think about it carefully.
As sometimes expressed, version is not a time machine. Leonardo's first point is the main point here: only experiment in some previous version(s) of Stata will establish what works, and even that requires circumspection, as in the worst scenario some commands may work but their behaviour may differ (e.g. if bugs were corrected). On the whole that is rare but not impossible.
It could not be otherwise because the only way setting version number would restore entire previous behaviour is if Stata X includes within itself entire copies of all previous versions. and StataCorp doesn't distribute Stata like that. I'd be astonished to hear of any major software distributed like that. In fact, even something like version is comparatively rare outside Stata. (Free software doesn't really need this, any way, as would be a reasonable if not gleeful remark.)
A do-file raises specific issues. Here are some
1. You have close collaborators on a current project but they have different versions of Stata. Then you should certainly prefer to write code that works with everybody's Srara.
2. You did something you are proud of and imagine that other people will want to emulate it or treat it as a good example, in which case what versions of Stata will run it is of some interest but perhaps not quite so crucial. At some limit, sorry, but you need a more up-to-date version of Stata to run this is inevitable as an answer.
3. You need to present reproducible code e.g. for a journal submission. This is loosely similar to #2.
Other people's code is usually much harder to use or understand than do-file writers imagine, but that's a different story. It's all too easy to slip into assuming something that is not true for or not clear to others. That's why writing programs in ado files is quite challenging, although they typically (should) address a very well definedspecific task, not much of a specific project.
Comment