SAVE Subcommand (NLR command)
SAVE is
used to save the temporary variables for the predicted values, residuals,
and derivatives that are created by the model and the derivatives
programs.
- The minimum specification is a single keyword.
- The variables to be saved must have unique names on the active dataset. If a naming conflict exists, the variables are not saved.
- Temporary variables—for example, variables
that are created after a
TEMPORARYcommand and parameters that are specified by the model program—are not saved in the active dataset. They will not cause naming conflicts.
The following keywords are available and can be used in any combination and in any order. The new variables are always appended to the active dataset in the order in which these keywords are presented here:
PRED. Save the predicted values. The variable's name, label, and formats are those specified for it (or assigned by default) in the model program.
RESID [(varname)]. Save the residuals
variable. You can specify a variable name in parentheses
following the keyword. If no variable name is specified, the name
of this variable is the same as the specification that you use for
this keyword. For example, if you use the three-character abbreviation
RES, the default variable name
will be RES. The variable has the
same print and write format as the predicted values variable that
is created by the model program. It has no variable label and no user-defined
missing values. It is system-missing for any case in which either
the dependent variable is missing or the predicted value cannot be
computed.
DERIVATIVES. Save the derivative
variables. The derivative variables are named with the
prefix D. to the first six characters
of the parameter names. Derivative variables use the print and write
formats of the predicted values variable and have no value labels
or user-missing values. Derivative variables are saved in the same
order as the parameters named on MODEL PROGRAM. Derivatives are saved for all parameters, whether or not the derivative
was supplied in the derivatives program.
LOSS. Save the user-specified
loss function variable. This specification is available
only with CNLR and only if the LOSS subcommand has been specified.
Asymptotic standard errors of predicted values
and residuals, and special residuals used for outlier detection and
influential case analysis are not provided by the [C]NLR procedure. However, for a squared
loss function, the asymptotically correct values for all these statistics
can be calculated by using the SAVE subcommand with [C]NLR and
then using the REGRESSION procedure.
In REGRESSION, the dependent
variable is still the same, and derivatives of the model parameters
are used as independent variables. Casewise plots, standard errors
of prediction, partial regression plots, and other diagnostics of
the regression are valid for the nonlinear model.
Example
MODEL PROGRAM A=.5 B=1.6.
COMPUTE PSTOP=A*SPEED**B.
NLR STOP /PRED=PSTOP
/SAVE=RESID(RSTOP) DERIVATIVES PRED.
REGRESSION VARIABLES=STOP D.A D.B /ORIGIN
/DEPENDENT=STOP /ENTER D.A D.B /RESIDUALS.
- The
SAVEsubcommand creates the residuals variable RSTOP and the derivative variables D.A and D.B. - Because the
PREDsubcommand identifies PSTOP as the variable for predicted values in the nonlinear model, keywordPREDonSAVEadds the variable PSTOP to the active dataset. - The new variables are added to the active dataset in the following order: PSTOP, RSTOP, D.A, and D.B.
- The subcommand
RESIDUALSforREGRESSIONproduces the default analysis of residuals.