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 withzeros

From   Clare L Maxwell <>
Subject   Re: RE: st: right justifying strings, left padding strings withzeros
Date   Wed, 23 Nov 2005 07:50:44 -0600

Thank you, thank you, Nick Cox, as much as anything for the delightful observation that "three is an engaging number." I searched my emotional reaction to this proposition and found that it is true!

Thank you for your encouragement. I am trying to scan the st: mail for things I might use in the future and save some of it. I did check out the UCLA Stata site, which has come good stuff, but didn't have what I wanted here. I will pay more attention to Stata's own FAQs. I have probably unfairly assumed that they would be similar to the online command help. I will also consider the Stata Journal. Interesting to know that you are an editor. At least I can now assume taht you are paid by Stata, since I wondered how you were able to reply intelligently to every single statalist question. I still wonder if you sleep, but that is your affair. It was amazing to wake up this morning way too early and find the answer to my question already waiting for me.

Yours truly,
Clare Maxwell

At 1:23 PM +0000 11/23/05, n j cox wrote:

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:
*   For searches and help try:

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