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

Re: st: basic if statement

From   Keith Dear <>
Subject   Re: st: basic if statement
Date   Mon, 23 Jul 2007 14:31:42 +1000

Instead, write "list var1 if var2==float(.07)".

It's explained at:


At 02:17 PM 23/07/2007, Donald Braman wrote:
I'm trying to understand how the if statement works. I have two
variables, var1 and var2.  let's say that they're as follows:

var1   var2
.09     0
.01     0
.03    .07
.05    .07
.09    .08

If I type "list var1 if var2==0", I get, as I expected, a result list
containing .09 & .01 .

But if I type "list var1 if var2==.07", I get nothing.

Clearly, I'm missing something. What? (I've attached the data in case
that helps.)

Content-Type: application/octet-stream; name="data.dta"
Content-Disposition: attachment; filename="data.dta"
X-Attachment-Id: f_f4gg6afq
*   For searches and help try:

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