Statalist


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

st: if syntax parser


From   "Hiroyuki Kawakatsu" <[email protected]>
To   [email protected]
Subject   st: if syntax parser
Date   Sat, 29 Mar 2008 11:45:02 +0000

hi,

am i the only one who finds the following "feature" of the stata if
syntax parser worrying? (i observed a student doing this and was
expecting stata to correct him...):

/*begin sample code*/

set obs 10
gen x = 1
gen t = _n

sum x if 2<t<5    /*what do you expect?*/

/*further experiments*/
sum x if 2<t>5    /*?*/
sum x if 2==t==5  /*correct?*/
sum x if 2|t|5    /*ok*/

/*end sample code*/

h.
-- 
----------------------------------
Hiroyuki Kawakatsu
Business School
Dublin City University
Dublin 9, Ireland
Tel +353 (0)1 700 7496
*
*   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