select (dataloop)

Purpose

Selects specific rows (observations) in a data loop based on a logical expression.

Format

select logical_expression;

Examples

select age > 40 AND sex $== 'MALE';

Remarks

Selects only those rows for which logical_expression is TRUE. Any variables referenced must already exist, either as elements of the source dataset, as extern’s, or as the result of a previous make, vector, or code statement.

See also

delete