Element by element test for whether values are between two other values.
Syntax: @ebtw(x, v1, v2)
x: numeric or alphanumeric object
v1: numeric or alphanumeric object
v2: numeric or alphanumeric object
Return: vector or matrix object
where v1 and v2 correspond to the low and high values of the range.
Returns indicators equal to 1 for elements where x is greater than or equal to v1 and less than or equal to v2, and 0 otherwise.
Examples
vector d1 = @ebtw(x, 10, 100)
creates a dummy variable that takes the value 1 where the value of X is in the range defined by the values 10 and 100.
vector d2 = @ebtw(x, lowvals, highvals)
creates a dummy variable that takes the value 1 where the value of X is in the range defined by the series LOWVALS and HIGHVALS.
vector d3 = @ebtw("myval", svalslow, svalshigh)
tests for whether the string “myval” is between the low and high values in the string vectors SVALSLOW and SVALSHIGH.
Cross-references