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: inlist( variable, .a, .b, .c)


From   Eric Booth <[email protected]>
To   [email protected]
Subject   Re: st: inlist( variable, .a, .b, .c)
Date   Tue, 10 Apr 2012 13:17:05 -0500

<>

It looks like it works with Stata 12.1 MP on Mac OSX 10.7:

sysuse  auto, clear
keep rep78
recode rep78 (. = .b)
g i = 1 if inlist(rep78, .b)

. list

     +-----------+
     | rep78   i |
     |-----------|
  1. |     3   . |
  2. |     3   . |
  3. |    .b   1 |
  4. |     3   . |
  5. |     4   . |
     |-----------|
  6. |     3   . |
  7. |    .b   1 |
  8. |     3   . |
.....

- Eric

__
Eric A. Booth
Public Policy Research Institute 
Texas A&M University
[email protected]
+979.845.6754



On Apr 10, 2012, at 1:11 PM, Stas Kolenikov wrote:

> I am trying to manipulate some extended missing values, and found that
> a very handy -inlist()- function does not work with them. The
> documentation states that the arguments of -inlist- must be either all
> strings or all reals. Apparently, the latter category excludes the
> system missing values. Of course I can write all of this with
> (variable == .a | variable == .b | variable == .c), but the whole idea
> of -inlist()- is to avoid these cumbersome statements. That was the
> grumble, and the wish is to have -inlist()- support the system missing
> values.
> 
> -- 
> Stas Kolenikov, also found at http://stas.kolenikov.name
> Small print: I use this email account for mailing lists only.
> *
> *   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index