__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.