SAVE Subcommand (DISCRIMINANT command)
SAVE
allows
you to save casewise information as new variables in the active dataset.
-
SAVE
applies only to the current analysis block. To save casewise results from more than one analysis, specify aSAVE
subcommand in each analysis block. - You can specify a variable name for
CLASS
and rootnames forSCORES
andPROBS
to obtain descriptive names for the new variables. - If you do not specify a variable name for
CLASS
, the program forms variable names using the formula DSC_m, where m increments to distinguish group membership variables saved on differentSAVE
subcommands for different analysis blocks. - If you do not specify a rootname for
SCORES
orPROBS
, the program forms new variable names using the formula DSCn_m, where m increments to create unique rootnames and n increments to create unique variable names. For example, the first set of default names assigned to discriminant scores or probabilities are DSC1_1, DSC2_1, DSC3_1, and so on. The next set of default names assigned will be DSC1_2, DSC2_2, DSC3_2, and so on, regardless of whether discriminant scores or probabilities are being saved or whether they are saved by the sameSAVE
subcommand. - The keywords
CLASS
,SCORES
, andPROBS
can be used in any order, but the new variables are always added to the end of the active dataset in the following order: first the predicted group, then the discriminant scores, and finally probabilities of group membership. - Appropriate variable labels are automatically generated. The labels describe whether the variables contain predictor group membership, discriminant scores, or probabilities, and for which analysis they are generated.
- The
CLASS
variable will use the value labels (if any) from the grouping variable specified for the analysis. - When
SAVE
is specified with any keyword,DISCRIMINANT
displays a classification processing summary table and a prior probabilities for groups table. - You cannot use the
SAVE
subcommand if you are replacing the active dataset with matrix materials (see Matrix Output) .
CLASS [(varname)]. Predicted group membership.
SCORES [(rootname)]. Discriminant
scores. One score is saved for each discriminant function
derived. If a rootname is specified, DISCRIMINANT
will append a sequential number to the name to form new variable
names for the discriminant scores.
PROBS [(rootname)]. For each case,
the probabilities of membership in each group. As many
variables are added to each case as there are groups. If a rootname
is specified, DISCRIMINANT
will
append a sequential number to the name to form new variable names.
Example
DISCRIMINANT GROUPS=WORLD(1,3)
/VARIABLES=FOOD TO FSALES
/SAVE CLASS=PRDCLASS SCORES=SCORE PROBS=PRB
/ANALYSIS=FOOD SERVICE COOK MANAGER FSALES
/SAVE CLASS SCORES PROBS.
- Two analyses are specified. The first uses all variables
named on the
VARIABLES
subcommand and the second narrows down to five variables. For each analysis, aSAVE
subcommand is specified. - For each analysis,
DISCRIMINANT
displays a classification processing summary table and a prior probabilities for groups table. - On the first
SAVE
subcommand, a variable name and two rootnames are provided. With three groups, the following variables are added to each case:Table 1. Saved variables based on rootnames Name Variable label Description PRDCLASS Predicted group for analysis 1 Predicted group membership SCORE1 Function 1 for analysis 1 Discriminant score for function 1 SCORE2 Function 2 for analysis 1 Discriminant score for function 2 PRB1 Probability 1 for analysis 1 Probability of being in group 1 PRB2 Probability 2 for analysis 1 Probability of being in group 2 PRB3 Probability 3 for analysis 1 Probability of being in group 3 - Since no variable name or rootnames are provided
on the second
SAVE
subcommand,DISCRIMINANT
uses default names. Note that m serves only to distinguish variables saved as a set and does not correspond to the sequential number of an analysis. To find out what information a new variable holds, read the variable label, as shown in the following table:
Name | Variable label | Description |
---|---|---|
DSC_1 | Predicted group for analysis 2 | Predicted group membership |
DSC1_1 | Function 1 for analysis 2 | Discriminant score for function 1 |
DSC2_1 | Function 2 for analysis 2 | Discriminant score for function 2 |
DSC1_2 | Probability 1 for analysis 2 | Probability of being in group 1 |
DSC2_2 | Probability 2 for analysis 2 | Probability of being in group 2 |
DSC3_2 | Probability 3 for analysis 2 | Probability of being in group 3 |