Command Reference : Function Reference : Function Reference: V
  
 
@valcount
Count of matching values.
Syntax: @valcount(x, y)
x: data object
y: value or string
Return: number
The number of elements in x that match y. Note that numeric matches require an exact match.
For series and alpha calculations, EViews will use the current or specified workfile sample.
Examples
Let X be a series of length 5 whose elements are 1, 2, 5, 4, 2. Then
= @valcount(x, 2)
returns 2, while
= @valcount(x, 2.000000000000000000001)
returns 0.
Consider the string vector A where
svector a = @sfill("pear", "bear", "ear")
Then the command
= @valcount(a, "ear")
returns the value 1, while
= @valcount(@right(a, 3), "ear")
returns 3.
Cross-references
See also @between, @ebtw.