Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: if command


From   "Danielle H. Ferry" <dferry@nber.org>
To   statalist@hsphsun2.harvard.edu
Subject   st: if command
Date   Thu, 12 Feb 2004 15:26:26 -0500

Hi,

Can anyone please explain when the if command requires quotes around the expression and when it does not?

For example, I've found the following seemingly quirky behavior:

1) if "`1'"=="aRate" | "`1'"=="bRate" | "`1'"=="pRate" --> requires quotes
2) if `1'==aRate --> does not require quotes
3) if "`1'"=="apRatio" --> requires quotes

Danielle Ferry

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