Statalist


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

Re: st: AW: listing variables with certain characteristics


From   Jeph Herrin <[email protected]>
To   [email protected]
Subject   Re: st: AW: listing variables with certain characteristics
Date   Thu, 27 Aug 2009 15:18:31 -0400

My esteem of Nick not withstanding, his assertion:

 "7. -ds- remains an official command. There is absolutely
  nothing unofficial about it."

is contradicted in my mind by the first line of the
help file in Stata 11:

 "ds continues to work but, as of Stata 9, is no longer an official
  part of Stata."

Now, if "official" is a dichotomous state, and StataCorp is
the ultimate arbiter of what is official and what is not, I would
have to say that Nick's "absolutely" might be unwarranted.

cheers,
Jeph



Martin Weiss wrote:
<>




"-ds- seems to be on the verge of extinction."

See Nick`s recent statement number 7 to the contrary here:
http://www.stata.com/statalist/archive/2009-08/msg00899.html




HTH
Martin


-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Jeph Herrin
Gesendet: Donnerstag, 27. August 2009 21:02
An: [email protected]
Betreff: st: listing variables with certain characteristics


I have often found it helpful to keep track of
metadata associated with variables by assigning
it as characteristics. So, for instance, a variable
which is of type checkbox, in module 6, question 3
of a survey might have

    myvar[type]:        checkbox
    myvar[module]:      6
    myvar[question]:    3

and so on. What I'm looking for is a good way to
generate a list of variables that have, eg, module=6.

Right now, the best I can do is

   ds, has(char module)

to get the list of variables that have a "module"
characteristic, then loop over that list to pick
out the ones where module=6. This bothers me because
(a) it seems there should be a better way than looping
and (b) -ds- seems to be on the verge of extinction.

I'm about to write  my own utility to do this, since
I need to do it so often, but thought I'd see if there
wasn't a better way already out there. Is there a
a direct way to get a list of variables where the
characteristic exists and has a certain value?

thanks,
Jeph

*
*   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/


*
*   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/

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index