Examples (NAIVEBAYES command)
Predictor selection followed by model building
NAIVEBAYES default
/EXCEPT VARIABLES=preddef1 preddef2 preddef3 training
/TRAININGSAMPLE VARIABLE=training
/SAVE PREDVAL PREDPROB.
- This analysis specifies default as the response variable.
- All other variables are to be considered as possible predictors, with the exception of preddef1, preddef2, preddef3, and training.
- Cases with a value of 1 on the variable training are assigned to the training sample and used to create the series of predictor subsets, while all other cases are assigned to the test sample and used to select the "best" subset.
- Model-predicted values of default are saved to the variable PredictedValue.
- Model-estimated probabilities for the values of default are saved to the variables PredictedProbability_1 and PredictedProbability_2.
For discussion of output from this syntax and to place the example in context, see Using Naive Bayes for Predictor Selection and Classification.
Predictor selection only
NAIVEBAYES default
/EXCEPT VARIABLES=preddef1 preddef2 preddef3 validate
/TRAININGSAMPLE VARIABLE=validate
/SUBSET EXACTSIZE=5
/PRINT CLASSIFICATION=NO.
- The
NAIVEBAYES
procedure treats default as the dependent variable and selects a subset of five predictors from all other variables, with the exception of preddef1, preddef2, preddef3, and validate.