A TREND statement can be used with the TIMESERIES procedure to specify options related to trend analysis of the time-stamped
transactional data. Only one TREND statement is allowed. The options specified affect all variables specified in the VAR statements.
The following trend statistics are available:
- NOBS
-
number of observations
- N
-
number of nonmissing observations
- NMISS
-
number of missing observations
- MINIMUM
-
minimum value
- MAXIMUM
-
maximum value
- RANGE
-
range value
- SUM
-
summation value
- MEAN
-
mean value
- STDDEV
-
standard deviation
- CSS
-
corrected sum of squares
- USS
-
uncorrected sum of squares
- MEDIAN
-
median value
If none of the trend statistics are specified, the default is as follows:
trend n min max mean std;
The following options can be specified in the TREND statement following the slash (/):
-
NPERIODS= number
-
specifies the number of time periods to be stored in the OUTTREND= data set when the TRANSPOSE=YES option is specified. If
the TRANSPOSE option is not specified, the NPERIODS= option is ignored. The NPERIODS= option specifies the number of OUTTREND=
data set variables to contain the trend statistics and is therefore limited to the maximum allowed number of SAS variables.
If the NPERIODS= option is not specified, all of the periods specified between the ID statement START= and END= options are
stored. If at least one of the START= or END= options is not specified, the default magnitude is the seasonality specified
by the SEASONALITY= option in the PROC TIMESERIES statement or implied by the INTERVAL= option in the ID statement. If only
the START= option or both the START= and END= options are specified and the seasonality is zero, the default is NPERIODS=5.
If only the END= option or neither the START= nor END= option is specified and the seasonality is zero, the default is NPERIODS=–5.
-
TRANSPOSE= NO | YES
-
specifies which values are recorded as column names in the OUTTREND= data set. TRANSPOSE=YES specifies that the time periods
be recorded as the column names instead of the statistics as the column names. The first and last time periods stored in the
OUTTREND= data set correspond to the period of the ID statement START= and END= options, respectively. If only the ID statement
END= option is specified, the last time ID value of each accumulated time series corresponds to the last time period column.
If only the ID statement START= option is specified, the first time ID value of each accumulated time series corresponds to
the first time period column. If neither the START= option nor the END= option is specified with the ID statement, the first
time ID value of each accumulated time series corresponds to the first time period column. The TRANSPOSE=NO option is useful
for analyzing or displaying the trend analysis results with SAS/GRAPH procedures. The TRANSPOSE=YES option is useful for analyzing
the trend analysis results with other SAS procedures or SAS Enterprise Miner software. The default is TRANSPOSE=NO.