The REG Procedure

Syntax: REG Procedure

The following statements are available in the REG procedure:

PROC REG <options> ;
<label:> MODEL dependents = <regressors> </ options> ;
BY variables ;
FREQ variable ;
ID variables ;
VAR variables ;
WEIGHT variable ;
ADD variables ;
CODE <options> ;
DELETE variables ;
<label:> MTEST <equation,, equation> </ options> ;
OUTPUT <OUT=SAS-data-set> <keyword=names> <…keyword=names> ;
PAINT <condition |ALLOBS> </ options> |<STATUS |UNDO> ;
PLOT <yvariable*xvariable> <=symbol> <…yvariable*xvariable> <=symbol> </ options> ;
PRINT <options> <ANOVA> <MODELDATA> ;
REFIT ;
RESTRICT equation,, equation ;
REWEIGHT <condition |ALLOBS> </ options> |<STATUS |UNDO> ;
STORE <options> ;
<label:> TEST equation, <,, equation> </ option> ;

Although there are numerous statements and options available in PROC REG, many analyses use only a few of them. Often you can find the features you need by looking at an example or by scanning this section.

In the preceding list, brackets denote optional specifications, and vertical bars denote a choice of one of the specifications separated by the vertical bars. In all cases, label is optional.

The PROC REG statement is required. To fit a model to the data, you must specify the MODEL statement. If you want to use only the options available in the PROC REG statement, you do not need a MODEL statement, but you must use a VAR statement. (See the example in the section OUTSSCP= Data Sets.) Several MODEL statements can be used. In addition, several MTEST, OUTPUT, PAINT, PLOT, PRINT, RESTRICT, and TEST statements can follow each MODEL statement.

The ADD, DELETE, and REWEIGHT statements are used interactively to change the regression model and the data used in fitting the model. The ADD, DELETE, MTEST, OUTPUT, PLOT, PRINT, RESTRICT, and TEST statements implicitly refit the model; changes made to the model are reflected in the results from these statements. The REFIT statement is used to refit the model explicitly and is most helpful when it follows PAINT and REWEIGHT statements, which do not refit the model.

The BY, FREQ, ID, VAR, and WEIGHT statements are optionally specified once for the entire PROC step, and they must appear before the first RUN statement.

When a TYPE=CORR, TYPE=COV, or TYPE=SSCP data set is used as an input data set to PROC REG, statements and options that require the original data are not available. Specifically, the OUTPUT, PAINT, PLOT, and REWEIGHT statements and the MODEL and PRINT statement options P, R, CLM, CLI, DW, DWPROB, INFLUENCE, PARTIAL, and PARTIALDATA are disabled.

You can specify the following statements with the REG procedure in addition to the PROC REG statement:

ADD

adds independent variables to the regression model.

BY

specifies variables to define subgroups for the analysis.

CODE

requests that the procedure write SAS DATA step code to a file or catalog entry for computing predicted values according to the fitted model.

DELETE

deletes independent variables from the regression model.

FREQ

specifies a frequency variable.

ID

names a variable to identify observations in the tables.

MODEL

specifies the dependent and independent variables in the regression model, requests a model selection method, displays predicted values, and provides details on the estimates (according to which options are selected).

MTEST

performs multivariate tests across multiple dependent variables.

OUTPUT

creates an output data set and names the variables to contain predicted values, residuals, and other diagnostic statistics.

PAINT

paints points in scatter plots.

PLOT

generates scatter plots.

PRINT

displays information about the model and can reset options.

REFIT

refits the model.

RESTRICT

places linear equality restrictions on the parameter estimates.

REWEIGHT

excludes specific observations from analysis or changes the weights of observations used.

STORE

requests that the procedure requests that the procedure save the estimated parameters of the fitted model.

TEST

performs an F test on linear functions of the parameters.

VAR

lists variables for which crossproducts are to be computed, variables that can be interactively added to the model, or variables to be used in scatter plots.

WEIGHT

declares a variable to weight observations.

The CODE and STORE statements are also used by many other procedures. A summary description of functionality and syntax for these statements is also shown after the PROC REG statement in alphabetical order, but you can find full documentation about them in the section STORE Statement in Chapter 19: Shared Concepts and Topics.