SAVE Subcommand (TREE command)
The SAVE
subcommand
writes optional model variables to the active dataset.
- Specify one or more model variables.
- Optionally, you can specify new variable names in parentheses after each model variable name. The names must be unique, valid variable names.
- If new names are not specified, or if specified names are not valid variable names, unique variable names are automatically generated using the model variable name with a suffix.
NODEID. Node identifier. The terminal node to which a case is assigned. The value is the tree node number.
PREDVAL. Predicted value. The class or value predicted by the model.
PREDPROB. Predicted
probability. The probability associated with the model’s
prediction. One variable is saved for each category of the dependent
variable. If you specify an optional variable name, it is used as
a root for generated variable names. PREDPROB
is ignored if the dependent variable is a scale variable. Probabilities
are saved only for the first 126 categories of the dependent variable
when the CRT or QUEST algorithms are used.
ASSIGNMENT. Sample assignment. The variable indicates whether a case was used in the training or
testing sample. Cases in the training sample have a value of 1, and
cases in the testing sample have a value of 0. ASSIGNMENT
is ignored if split-sample validation is not
specified.
Example
TREE risk [o] BY income age creditscore
/SAVE NODEID(node_number) PREDVAL(predicted_value).