User Tools

Site Tools


cluster:stata

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

cluster:stata [2018/10/01 18:04] – created mcloughlincluster:stata [2024/11/11 20:53] (current) – removed mcloughlin
Line 1: Line 1:
-====== Stata ====== 
-Please contribute to this page by including any helpful tips or suggestions related to Stata or it's use on different operating systems. 
- 
-===== Running Stata on the Cluster ===== 
-The cluster contains v14 of both Stata/IC and Stata/MP. (To run your jobs using Stata/IC instead of Stata/MP, please use ''stata'' instead of ''stata-mp'' in all commands.). Version 13.1 of both stata/SE and stata/MP are also installed (see /usr/local/stata13/). 
- 
-You can run the text-based interface of Stata interactively on the cluster with: 
-<code> 
-stata-mp 
-</code> 
- 
-or if you have an setup [[X Forwarding]] (see also [[http://www.stata.com/support/faqs/unix/remote.html|X-Windows server]]) then use (note xstata not available on all cluster machines) 
-<code>  
-xstata 
-</code> 
- 
-You can also run a .do file in batch mode with 
-<code> 
-stata-mp -b do dofile.do 
-</code> 
- 
-To allow your do-file to continue running when you log off from your terminal, preface the command with "nohup". For example: 
-<code> 
-nohup stata-mp -b do dofile.do & 
-</code> 
- 
-This is very useful because it means you don't have to keep your terminal or even your computer running - you can log off of the cluster, log off of the lab PC you're using, and then come back to the cluster when your job is done, even from another computer. 
- 
-For more information on how to run your Stata command in the background, see [[Managing_Jobs|Managing Jobs]] 
- 
-==== Temporary Files ==== 
-By default, Stata saves tempfiles (from -tempfile- or -preserve-) to /home/stata-tmp/. If you would like Stata to save temporary files in a new location (e.g. $HOME/statatmp) then from the command-line execute the follow before executing Stata: 
-<code> 
-export STATATMP=$HOME/statatmp  
-</code> 
- 
-One reason you might want to do this is that files are removed from /home/stata-tmp/ if they haven't been touched for a day. If you have a Stata process that runs for longer this may cause problems with reading from tempfiles or -restore-. 
- 
-==== Package ==== 
-Problem: Stata Doesn't have Outreg! On my home computer, I use ''outreg'', ''estout'', or other custom Stata commands.  How do I install them on the cluster? 
- 
-Solution: You install them the same way on the cluster as you initially did at home: 
-<code> 
-ssc install outreg 
-</code> 
- 
-You will then have a folder installed within your home directory called "ado", which contains your new commands filed away. 
- 
-=== Helpful Files and Links from Raymond Guiteras === 
-[[http://fmwww.bc.edu/repec/bocode/t/textEditors.html|A guide to text editors. (Less relevant given the improvements in the do-file editor in Stata 11)]] 
- 
-StataCorp maintains an archive of notes and presentations from past Stata Users' Group meetings. Many of these presentations are extremely useful and enlightening. The archive page is located at [[http://www.stata.com/meeting/proceedings.html|this link]]. 
- 
-Some presentations that are especially useful and educational are: 
-  * [[http://www.stata.com/meeting/dcconf09/dc09_baum.pdf|"Implementing econometric estimators with Mata," by Christopher F. Baum and Mark E. Schaffer, 2009]] 
-  * [[http://www.stata.com/meeting/boston10/boston10_baum.pdf|"Evaluating one-way and two-way cluster–robust covariance matrix estimates," by Christopher F. Baum and Mark E. Schaffer, 2010]] 
-  * [[http://www.stata.com/meeting/snasug08/nichols_gmm.pdf|"GMM Estimation in Mata," by Austin Nichols, 2008.]] 
-  * [[http://www.stata.com/meeting/wcsug07/cameronwcsug.pdf|"Panel data methods for microeconometrics using Stata," by Colin Cameron, 2007.]] 
- 
-The Stata Journal is a nice resource, especially the Mata Matters articles. Issues that are more than 3 years old are available free. Here are links to a few articles that are particularly handy: 
-  * [[http://www.stata-journal.com/article.html?article=pr0018|"Suggestions on Stata programming style," by Nick Cox, Stata Journal, Vol. 5 Num. 5, 2005.]] 
-  * [[http://www.stata-journal.com/article.html?article=pr0021|"Mata Matters: Creating new variables—sounds boring, isn't," by William Gould, Stata Journal Vol. 6 Num. 1, 2006.]] 
-  * [[http://www.stata-journal.com/article.html?article=pr0025|"Mata Matters: Precision," by William Gould, Stata Journal Vol. 6 Num. 4, 2006.]] 
- 
-==Tips from Students== 
-  * Use the [[http://www.stata.com/help.cgi?winexec|winexec]] (in Windows) or "!" as a prefix (in Unix/Linux) to execute the rest of the line as a shell command. Note that these don't work in "batch" mode on Windows. 
  
cluster/stata.1538417082.txt.gz · Last modified: 2018/10/01 18:04 by mcloughlin