Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: AW: levelsof problem?


From   joe j <[email protected]>
To   [email protected]
Subject   Re: st: AW: levelsof problem?
Date   Wed, 28 Jul 2010 21:03:30 +0200

Thanks again , Nick, for your new set of suggestions. Tagging looks
really interesting.

Indeed I should have told you the full story at the outset (I had no
clue when I started this thread that a fuller explanation  was
necessary.)

I'd of course agree with  Clyde that an extended macro from Stata
Corp.  would be of great value.
Joe.

On Wed, Jul 28, 2010 at 6:32 PM, Nick Cox <[email protected]> wrote:
> What you didn't tell us turns out to be important. (That's a fact, not a criticism.)
>
> Another possibility you might consider is tagging e.g. all EU variables with a characteristic. See help for -char-.
>
> You could do this once and for all with
>
> foreach v of var DE_* NL_* {
>        char def `v'[eu] eu
> }
>
> after which you can things like
>
> ds *_F, has(char eu)
>
> and the subset of names of variables with "eu" characteristic defined will be produced and will be accessible as r(varlist).
>
> With -findname- (SJ) the syntax would be
>
> findname *_F, charname(eu)
>
> and -findname- also allows you to put the list of variable names directly into a local macro. -findname- is my attempt to improve on official -ds-, not quite as hubristic as that might appear.
>
> Of course, the varlist will be longer than DE_* NL_*.
>
> Characteristics are saved with datasets, an important detail.
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index