Stata 15 help for if

Title

[U] 11.1.3 if exp

Syntax

command if exp

exp in the syntax diagram means an expression, such as age>21. See exp for an explanation of expressions.

There is another if used in Stata programming; see [P] if.

Description

if at the end of a command means the command is to use only the data specified. if is allowed with most Stata commands.

Examples

. sysuse auto . list make mpg if mpg>25 . list make mpg if mpg>25 & mpg<30 . list make mpg if mpg>25 | mpg<10 . regress mpg weight displ if foreign==1

Equality tests are performed by two equal signs (==), not one =; see operators.


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