Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
The REG Procedure

PAINT Statement

PAINT < condition | ALLOBS > < / options > ;
PAINT < STATUS | UNDO > ;
The PAINT statement selects observations to be painted or highlighted in a scatter plot on line printer output; the PAINT statement is ignored if the LINEPRINTER option is not specified in the PROC REG statement.

All observations that satisfy condition are painted using some specific symbol. The PAINT statement does not generate a scatter plot and must be followed by a PLOT statement, which does generate a scatter plot. Several PAINT statements can be used before a PLOT statement, and all prior PAINT statement requests are applied to all later PLOT statements.

The PAINT statement lists the observation numbers of the observations selected, the total number of observations selected, and the plotting symbol used to paint the points.

On a plot, paint symbols take precedence over all other symbols. If any position contains more than one painted point, the paint symbol for the observation plotted last is used.

The PAINT statement cannot be used when a TYPE=CORR, TYPE=COV, or TYPE=SSCP data set is used as the input data set for PROC REG. Also, the PAINT statement cannot be used for models with more than one dependent variable. Note that the syntax for the PAINT statement is the same as the syntax for the REWEIGHT statement.

For detailed examples of painting scatter plots, see the section "Painting Scatter Plots".

Specifying Condition

Condition is used to select observations to be painted. The syntax of condition is
variable compare value
or
variable compare value logical variable compare value
where
variable
is one of the following:
compare
is an operator that compares variable to value. Compare can be any one of the following: <, <=, >, >=, =,  =. The operators LT, LE, GT, GE, EQ, and NE can be used instead of the preceding symbols. Refer to the "Expressions" section in SAS Language Reference: Concepts for more information on comparison operators.
value
gives an unformatted value of variable. Observations are selected to be painted if they satisfy the condition created by variable compare value. Value can be a number or a character string. If value is a character string, it must be eight characters or less and must be enclosed in quotes. In addition, value is case-sensitive. In other words, the statements

   paint name='henry';
and

   paint name='Henry';
are not the same.
logical
is one of two logical operators. Either AND or OR can be used. To specify AND, use AND or the symbol &. To specify OR, use OR or the symbol |.

Examples of the variable compare value form are

   paint name='Henry';
   paint residual.>=20;
   paint obs.=99;
Examples of the variable compare value logical variable compare value form are

   paint name='Henry'|name='Mary';
   paint residual.>=20 or residual.<=10;
   paint obs.>=11 and residual.<=20;


Using ALLOBS

Instead of specifying condition, the ALLOBS option can be used to select all observations. This is most useful when you want to unpaint all observations. For example,

   paint allobs / reset;
resets the symbols for all observations.

Options in the PAINT Statement

The following options can be used when either a condition is specified, the ALLOBS option is specified, or when nothing is specified before the slash. If only an option is listed, the option applies to the observations selected in the previous PAINT statement, not to the observations selected by reapplying the condition from the previous PAINT statement. For example, in the statements

   paint r.>0 / symbol='a';
   reweight r.>0;
   refit;
   paint / symbol='b';
the second PAINT statement paints only those observations selected in the first PAINT statement. No additional observations are painted even if, after refitting the model, there are new observations that meet the condition in the first PAINT statement.

Note: Options are not available when either the UNDO or STATUS option is used.

You can specify the following options after a slash (/).

NOLIST
suppresses the display of the selected observation numbers. If the NOLIST option is not specified, a list of observations selected is written to the log. The list includes the observation numbers and painting symbol used to paint the points. The total number of observations selected to be painted is also shown.

RESET
changes the painting symbol to the current default symbol, effectively unpainting the observations selected. If you set the default symbol by using the SYMBOL= option in the PLOT statement, the RESET option in the PAINT statement changes the painting symbol to the symbol you specified. Otherwise, the default symbol of '1' is used.

SYMBOL = 'character'
specifies a painting symbol. If the SYMBOL= option is omitted, the painting symbol is either the one used in the most recent PAINT statement or, if there are no previous PAINT statements, the symbol '@'. For example,

   paint / symbol='#';
changes the painting symbol for the observations selected by the most recent PAINT statement to '#'. As another example,

   paint temp lt 22 / symbol='c';
changes the painting symbol to 'c' for all observations with TEMP<22. In general, the numbers 1, 2, ... , 9 and the asterisk are not recommended as painting symbols. These symbols are used as default symbols in the PLOT statement, where they represent the number of replicates at a point. If SYMBOL='' is used, no painting is done in the current plot. If SYMBOL=' ' is used, observations are painted with a blank and are no longer seen on the plot.

STATUS and UNDO

Instead of specifying condition or the ALLOBS option, you can use the STATUS or UNDO option as follows:

STATUS
lists (on the log) the observation number and plotting symbol of all currently painted observations.

UNDO
undoes changes made by the most recent PAINT statement. Observations may be, but are not necessarily, unpainted. For example,

   paint obs. <=10 / symbol='a';
   ...other interactive statements
   paint obs.=1 / symbol='b';
   ...other interactive statements
   paint undo;


The last PAINT statement changes the plotting symbol used for observation 1 back to 'a'. If the statement

   paint / reset;
is used instead, observation 1 is unpainted.

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.