Some code has a main " replication.do" or " main.do" etc., which will have lines such as do tables.do If you need to create more than one log file make sure that you change the name first (adjust "logfile_cdate'.log"`). The code for creating log files can be found in the template-config file. Log files are also useful for debugging when the code is very long and doesn’t fit into the Stata results window. Oftentimes authors will not create separate output files for the results so you’ll be required to scroll through the log file to find them. do files already contain code creating them). Graph export Figure.png MAIN DO FILE Log files:Īlways create log files for the main. If a manuscript contains figures but the authors do not include code to automatically export those figures, there exists very straightforward code to fix this.
If packages need to be installed, the ideal way is to capture them all in a setup program, e.g., 00_setup.do that is then run before any other.
Use the following: net install grc1leg, from("") If you encounter the grc1leg package, it cannot be installed by ssc install grc1leg. ado files, these contain Stata commands that are presumably called from the main. We have some other, somewhat more involved solutions, involving running Stata in Docker and have access to Stata versions 12, 13, 14, 16, and 17. This fix may be relevant when running into problems with the tobit regression. For example, to emulate Stata 12.1, use the following line: version 12.1 Use the version command to emulate running the program on an older version. Stata will then install the new extension into that directory instead of c:\ado\plus ( source ) I want to run my program in an older version of Stata? Where you would create a "ado" directory in the "project" folder you are currently using for the replication (i.e. Sysdir set PERSONAL "$basepath/ado/personal" Solution: Be sure you are including config.do, which has lines like global basepath "/path/to/your/project/directory" This issue usually occurs when running on a university system where you do not have rights to install to C: Issue: When trying to install some extension Stata shows an error message such as: _file c:\ado\plus\k already exists_ Please be sure to make a note of this installation in the REPLICATION.md!! Simply copy and paste into your config.do and change describe to install. When searching for a package, the Stata help browser will show in the address bar " net describe this_great_command, from(). (but see the details in the template-config.do - this should be added to the "config.do"!!) Try ssc install outreg2įollowed by net install this_great_command, from() Solution it usually means that you need to first install the command before running the. Issue: When an error message such as xml_tab command not recognized or outreg2 command not recognized appears.
Which will tell Stata to reference the provided packages, in-place, no installation or copying of files needed. (adjust the path as needed, remember to use globals!)
You can change the version of Stata that "runs" by including "version #" as a command. This should be added to the top of the authors' do file: include "config.do"Ī more elaborate example is Setting Stata compatibility mode Tips and tricks for working with other people's Stata programs Configuring Stata programsĪlways include a config.do file, based on template-config.do.