能不能查查帮助啊
或者把基础的书先看看。
----------------------------------------------------------------------------------------------------------
help for if manual: [U] 14 Language syntax
----------------------------------------------------------------------------------------------------------
if qualifier
command if exp
exp in the syntax diagram means an expression, such as age>21. See help exp for an explanation of
expressions.
There is another if used in Stata programming; see help ifcmd.
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
. 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
Note that equality tests are performed by ==, not a single =; see help operators.
Also see
Manual: [U] 14 Language syntax
Online: help for language; by, in
[此贴子已经被作者于2009-6-2 7:36:57编辑过]