| TEMPLATE Procedure: Plot Statements (Experimental) |
Expressions can be used for conditional processing and on plot statements to calculate values that are not in the data. For example, an expression could be used on a LINEPARM statement to calculate the slope of the line that the statement produces.
For conditional processing, an expression is specified in parentheses on an IF statement. The following example illustrates where to specify an expression in an IF statement:
IF( expression ) ODS-Graphs-statement(s); ENDIF;
For calculating values that are needed on a plot statement, an expression is specified as the argument of an EVAL() construct on an appropriate plot argument or option. The following example illustrates where to specify an expression in a plot statement:
SLOPE = EVAL( expression )
An expression can be formed with constants, data columns, dynamic variables, functions, or other expressions. The following example illustrates an expression in which the dynamic variables Age, Height, and Weight are used:
(...) dynamic Age Height Weight; (...) EVAL( Age * Height + Weight ** 2 )
The following example illustrates an expression in which the column variable Time and the SGE functions MEAN and ACF are used:
EVAL( MEAN( Time ) + ACF( Time, NLags=10 ))
The following example shows the general form of an expression:
operand < operator-1 operand-1 ... operator-n operand-n >
An operand can be any of the following values:
specifies a number or a string value. String values must be specified in quotes.
specifies a data column.
specifies a symbol that references a value or a column that is provided by the procedure at the time the graph is being created.
specifies a nested expression. To control processing, the nested expression can use parentheses to determine the order of operations.
specifies a function in the DATA step; SGE function, computation supported by the Statistical Graphics Engine; or ODS graphics function. When names collide, the number of function arguments is used to clarify the context. If there is more than one argument, it is assumed to be a SAS DATA step function. The following ODS Graphics functions are available:
|
||
|---|---|---|
| Function Name | Description | |
| CC | Cycle-Component | |
| DCOMP | Seasonal Decomposition | |
| IC | Irregular Component | |
| SA | Seasonal Adjusted | |
| SC | Seasonal Component | |
| SIC | Seasonal-Irregular Component | |
| TC | Trend Component | |
| TCC | Trend-Cycle Component | |
| TCS | Trend-Cycle-Seasonal Component | |
|
||
|---|---|---|
| Function Name | Description | |
| EXISTS | 1 if specified column exists, 0 otherwise | |
|
||
|---|---|---|
| Function Name | Description | |
| ARANK | Ascending Rank | |
| ASORT | Ascending Sort | |
| DRANK | Descending Rank | |
| DSORT | Descending Sort | |
| INDEX | Ascending Indices | |
| RANK | Ascending Rank | |
| SORT | Ascending Sort | |
Statistical functions operate as the DATA step functions of the same name.
|
||
|---|---|---|
| Function Name | Description | |
| CSS | Corrected Sum of Squares | |
| CV | Coefficient of Variation | |
| KURTOSIS | Kurtosis | |
| LCLM | Confidence Limit Below the Mean | |
| MAX | Largest (Maximum) Value | |
| MEAN | Mean | |
| MEDIAN | Median (50th Percentile) | |
| MIN | Smallest (Minimum) Value | |
| N | Number of Non-Missing Values | |
| NMISS | Number of Missing Values | |
| P1 | First Percentile | |
| P5 | Fifth Percentile | |
| P25 | Twenty-fifth Percentile | |
| P50 | Fiftieth Percentile | |
| P75 | Seventy-fifth Percentile | |
| P90 | Ninetieth Percentile | |
| P95 | Ninety-fifth Percentile | |
| P99 | Ninety-ninth Percentile | |
| PROBT | p-value for T Statistic of a Student | |
| Q1 | First Quartile | |
| Q3 | Third Quartile | |
| QRANGE | Interquartile Range | |
| RANGE | Range | |
| SKEWNESS | Skewness | |
| STDDEV | Standard Deviation | |
| STDERR | Standard Error of the Mean | |
| SUM | Sum | |
| SUMWGT | Sum of Weights | |
| T | T Statistic of a Student | |
| UCLM | Confidence Limit Above the Mean | |
| USS | Uncorrected Sum of Squares | |
| VAR | Variance | |
specifies a standard SAS WHERE clause operator, or operators.