Rich's profile.do

A way to automatically run commands every Stata is started is to create a file called "profile.do" in the folder where your Stata executable sits (e.g., c:\Program Files (x86)\Stata12, or \Applications\Stata). A simple example can be found here.

I use my profile.do to:

  • set my default working folder
  • let Stata know I keep personal ados in an unusual place
  • specify the graph scheme to be used and some other display and memory options

and in my Windows version I set paths for using specific software with Stata (StatTransfer, Mplus, R, WinEDT)

My MAC OS version

* =========== start of profile.do =======================
quietly {

   * Rich Jones 22 April 2017
   * Profile.do for mac
   cd /users/`c(username)'/dropbox/work
   global work "/users/`c(username)'/dropbox/work"
   noisily di _n _n _n  ///
   _col(10) "`c(current_date)'" _n ///
   _col(10) in green "Now Running MAC Profile"  _n ///
   _col(10) in green "current folder is " in yellow "`c(pwd)'" in green " <- \$work" ///
   _n _n _n 
   
   * set order directories are searched
   global S_ADO UPDATES;BASE;.;PERSONAL;PLUS;OLDPLACE
   sysdir set PERSONAL "/users/`c(username)'/dropbox/ado/personal"
   sysdir set PLUS  "/users/`c(username)'/dropbox/ado/plus"

   * sets stata graph schemes to a publication-friendlier format
   set scheme rnj , perm // s1manual

   * so you dont lose stuff off the screen.
   set scrollbufsize 2048000
   set maxvar 10000, perm
   set matsize 1000, perm
   set mem 799999, perm
   set more off, perm
}


My Windows version

* =========== start of profile.do =======================
quietly {
   global StatTransfer_path `"C:\Program Files\StatTransfer8\st.exe"'
   global WinEDT_path `"C:\Program Files\WinEdt Team\WinEdt 6\WinEdt.exe"'
   global mplus_path `"C:\Progra~1\Mplus\mplus.exe"' // use the short (8.3) path format for Mplus
   global mplus6_path `"C:\Progra~1\Mplus-612\Mplus\mplus.exe"' // use the short (8.3) path format for Mplus
   global mplusdemo7_path `"C:\Progra~1\MplusD~1\mpdemo7.exe"' // use the short (8.3) path format for Mplus
   * Some programs call rpath, some call Rterm_path
   global rpath `"C:\Program Files\R\R-2.13.0\bin\Rcmd.exe"'
   global Rterm_path `"C:\Program Files\R\R-2.13.0\bin\Rterm.exe"'
   * Set SITE, PERSONAL and PLUS directory
   sysdir set PERSONAL "C:\ado\personal"
   sysdir set PLUS  "C:\ado\plus"
   * set order directories are searched
   global S_ADO UPDATES;BASE;.;PERSONAL;PLUS;OLDPLACE
   * sets stata graph schemes to a publication-friendlier format
   set scheme Lean1, perm // s1manual
   * so you dont lose stuff off the screen.
   set scrollbufsize 2048000
   set maxvar 10000, perm
   set matsize 1000, perm
   set mem 799999, perm
   set more off, perm
}
* =========== end of profile.do =======================