Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Top 10 Tricks in Stata (summary to date)

From   Jesper Sorensen <sorensen@MIT.EDU>
Subject   Re: st: Top 10 Tricks in Stata (summary to date)
Date   Tue, 25 May 2004 10:13:02 -0400

No one has mentioned:

-stsplit- (originally due to Jeroen Weesie, now offifical Stata). Creating split-spell files used to be a real chore. No more.

-expand- is another exceedingly useful command, although I use it less since -stsplit- came along.

Finally, while not part of the software per se, statalist is a great source of tricks.


May I add:

1) Generating Variables with -by- in combination with _n, _N and explicit
subscribts: You have a serious data-managment problem? Think -by-!

2) Saved Results: I use them all the time and evererywhere!

3) file: You want your output ready for publication? -file- is your friend!

4) postfile: When I made my diploma I did not know anything about postfiles. I
printed dozens of output, underlined specific results in that output with a
yellow marker and typed that output into a Lotus 1-2-3 spreadsheet. Than I
transfered that spreadsheet ot Stata and made some graphs. I than realized
that I made a mistake and start again. It took me 6 months. Lately I made a
similar analysis. I used -postfile-. I took me 2 hours.

5) Here is mine
set matsize 200
set memory 60m
set scheme s1color
global F4 "dir *.dta ;"
global F5 "dir *.do ;"
global F6 "cd ~/pub/"
global F7 "cd  ~/pub/kkstata1e ;"
global F9 "do _marked;"
global dublin "~/data/dublin"
global em "~/data/em"
global issp "~/data/issp98"
global kkstata "~/pub/kkstata1e/kkstata"
global kkmain "~/pub/kkstata1e/"
global mas "~/data/mas"
global soep19 "~/data/gsoep19"
global stata "~/data/stata"

6) capture ;-)

 On Sun, 23 May 2004, Nick Cox wrote:
 > On Friday 21 May 2004 I asked
 > Which would we nominate as (say) the top ten tricks which are the
 > deepest and most Stataish features in what we use? What is _both_
 > simple _and_ deep?  What leads to great results with at most a few
 > lines of code?
 > ...
 > I'd nominate straight away
 > 1. -by:-.
 > 2. -foreach- or -forval- with varlists or numlists.
 > 3. -merge-. I rarely use it but -merge-masters have real leverage
 > in file manipulations.
 > 4. -assert-. My candidate for the most underestimated command in
 > Stata (second is -count-).
 > 5. -reshape-.
 > Any other nominations?
+49 (030) 25491-361

*   For searches and help try:
*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index