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

Re: RE: st: right justifying strings, left padding strings with zeros

From   n j cox <>
Subject   Re: RE: st: right justifying strings, left padding strings with zeros
Date   Wed, 23 Nov 2005 13:23:28 +0000

I suspect that Clare's question is not quite as general
as she has written it. The nub of the matter is, I think,
the documentation of Stata's _functions_, which is, by the
standards of most of the manuals, extraordinarily terse.

As I have commented previously, functions fall into
two main groups, those you know you want and those you
don't know you need, and the issue is the latter. Most of the user-written books give some attention to the functions, but
I am not sure that any does quite what you want here.
Various people have fantasised about "A Stata cookbook" or
"Stata by example" that would just be stuffed with lots and
lots of examples and code solutions, and a few people
would even like to write something like that, some day.
Whether such books would do what their readers would want,
I don't know. In any language, fluency does depend on
your own practice, an enormous amount of it, not on reading
phrase books.

Some more direct points:

1. The FAQs remain a under-used resource. Even if you are used to
scanning the titles, you are probably underestimating the
wealth of realistic code examples. There are intermittent
attempts to ensure that good examples from
Statalist get codified in the FAQs, but that's no-one's
top priority.

2. The Stata Journal puts a lot of emphasis on tutorial
articles and other expository material. The Stata tips
(three in every issue, because it is an engaging
number) often include examples on functions. Recently
we also had a tutorial on -cond()-. My role as an Editor
of the SJ obliges me also to mention the "Speaking
Stata" column, whose principal author combines surveys
of various Stata-linked topics, including functions,
with idiosyncratic commentary.

3. I suspect that many Statalist members maintain
private scrapbooks of bits and pieces that might be
useful to them, garnered as they came across them, and doing
the same is the best long-term way to get the resource
you want. The Statalist archives also contain many gems,
but of course amid so much else that is irrelevant for
this purpose.

>>> Clare L Maxwell

I wonder if either of you can recommend a book or manual that has
lots and lots of examples. It doesn't seem as if I'm getting what I
should out of staring at descriptions of the string functions, for
example. Ian Watson's solution is conceptually similar to how I
first approached it, but I didn't get far in mapping my ideas onto
the list of functions. Based on my previous problem so adroitly
handled by Nick Cox and others, I decided my usual ideas about how to
approach things are too colored by the data manipulation language I
am coming from, and that I need to clear the mental slate. That
wasn't exactly true here, but still I wasn't able to carry out what I
hoped to. I would be interested in feeding my brain "monkey see,
monkey do" patterns, hoping they would take hold.

Special thanks to Nick and Ian for these further examples of subinstr.
* For searches and help try:

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