Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: -if inlist-


From   "Sebastian F. B�chte" <[email protected]>
To   [email protected]
Subject   Re: st: -if inlist-
Date   Fri, 22 Dec 2006 15:06:11 +0100

On 12/22/06, Lucy Shum <[email protected]> wrote:
Hi all,

How do I specify more than one criterion for commands such as tabulate/
histogram ?

Can one do "-if inlist" twice for say, tabulate?

If not, how does one go about specifying two (or more) criteria in a
command?

Lucy
You can use inlist twice in an if statement, like this:

sysuse auto
tab price if inlist(mpg, 12, 14, 15) | inlist(trunk, 10, 11, 27)

regards
seb
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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