Code:
summarize x y if foo == 42
There is no problem here because selecting on variables and selecting on observations are just different ways of selecting data and compatible with each other.
But
Code:
keep x y
Code:
keep if foo == 42
Code:
keep x y if foo == 42
I (we) understand that you want
Code:
keep x y if foo == 42
Code:
keep x y keep if foo == 42
Code:
summarize x y summarize if foo == 42
Code:
summarize x y if foo == 42
Code:
* not recommended by its author program nigelkeep syntax [varlist] [if] if `"`varlist'`if'"' == "" error 198 if "`varlist'" != "" keep `varlist' if `"`if'"' != "" keep `if' end
Leave a comment: