Chapter Contents |
Previous |
Next |

The REG Procedure |

The following statements are available in PROC REG.

**PROC REG**< options >**;**- < label: >
**MODEL**dependents=<regressors> < / options >**;** **BY**variables**;****FREQ**variable**;****ID**variables**;****VAR**variables**;****WEIGHT**variable**;****ADD**variables**;****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**>**;** - < 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 "OUTSSCP= Data Sets" section.) 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 TYPE=CORR, TYPE=COV, or TYPE=SSCP data sets are used as input data sets 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, INFLUENCE, and PARTIAL 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.
- 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.
- 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.
- 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.

Chapter Contents |
Previous |
Next |
Top |

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