UNIQUEVALUES Procedure |
@UNIQUEVALUES returns a vector of sorted unique values for an input series over an indicated range.
@UniqueValues(options) series start end
Parameters
|
series |
source series |
|
start, end |
range of series to use. By default, the defined range of series. |
Options
VALUES=(output) VECTOR of values found in the series [required]
SMPL=standard SMPL option[not used]
Example
This extracts the unique values from the threshold series, then runs a set of threshold regressions over a subrange of those (excluding the fraction PI at either end).
@UniqueValues(values=testvalues) threshold startl endl
compute pistart=fix(pi*%size(testvalues)),piend=%size(testvalues)-pistart+1
do ttau=pistart,piend
compute ltau=testvalues(ttau)
set xsplit(1) = u{1}*(threshold>=ltau)
set xsplit(2) = u{1}*(threshold<ltau)
*
linreg(noprint) du startl endl
# xsplit du{1 to lags}
if ttau==pistart.or.%rss<rssbest
compute taubest=ltau,rssbest=%rss
end do tau
compute ltau=taubest
Copyright © 2025 Thomas A. Doan