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

st: if syntax parser

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


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

Hiroyuki Kawakatsu
Business School
Dublin City University
Dublin 9, Ireland
Tel +353 (0)1 700 7496
*   For searches and help try:

© Copyright 1996–2019 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index