The STEPDISC Procedure

Getting Started: STEPDISC Procedure

(View the complete code for this example.)

The data in this example are measurements of 159 fish caught in Finland’s Lake Laengelmaevesi; this data set is available from the Puranen. For each of the seven species (bream, roach, whitefish, parkki, perch, pike, and smelt) the weight, length, height, and width of each fish are tallied. Three different length measurements are recorded: from the nose of the fish to the beginning of its tail, from the nose to the notch of its tail, and from the nose to the end of its tail. The height and width are recorded as percentages of the third length variable. The fish data set is available from the Sashelp library. PROC STEPDISC will select a subset of the six quantitative variables that might be useful for differentiating between the fish species. This subset is used in conjunction with PROC CANDISC and PROC DISCRIM to develop discrimination models.

The following steps use PROC STEPDISC to select a subset of potential discriminator variables. By default, PROC STEPDISC uses stepwise selection on all numeric variables that are not listed in other statements, and the significance levels for a variable to enter the subset and to stay in the subset are set to 0.15. The following statements produce Figure 110.1 through Figure 110.5:

title 'Fish Measurement Data';

proc stepdisc data=sashelp.fish;
   class Species;
run;

PROC STEPDISC begins by displaying summary information about the analysis (see Figure 110.1). This information includes the number of observations with nonmissing values, the number of classes in the classification variable (specified by the CLASS statement), the number of quantitative variables under consideration, the significance criteria for variables to enter and to stay in the model, and the method of variable selection being used. The frequency of each class is also displayed.

Figure 110.1: Summary Information

Fish Measurement Data

The STEPDISC Procedure

The Method for Selecting Variables is STEPWISE
Total Sample Size158Variable(s) in the Analysis6
Class Levels7Variable(s) Will Be Included0
  Significance Level to Enter0.15
  Significance Level to Stay0.15

Number of Observations Read159
Number of Observations Used158

Class Level Information
SpeciesVariable
Name
FrequencyWeightProportion
BreamBream3434.00000.215190
ParkkiParkki1111.00000.069620
PerchPerch5656.00000.354430
PikePike1717.00000.107595
RoachRoach2020.00000.126582
SmeltSmelt1414.00000.088608
WhitefishWhitefish66.00000.037975


For each entry step, the statistics for entry are displayed for all variables not currently selected (see Figure 110.2). The variable selected to enter at this step (if any) is displayed, as well as all the variables currently selected. Next are multivariate statistics that take into account all previously selected variables and the newly entered variable.

Figure 110.2: Step 1: Variable HEIGHT Selected for Entry

Fish Measurement Data

The STEPDISC Procedure
Stepwise Selection: Step 1

Statistics for Entry, DF = 6, 151
VariableR-SquareF ValuePr > FTolerance
Weight0.375015.10<.00011.0000
Length10.601738.02<.00011.0000
Length20.609839.32<.00011.0000
Length30.628042.49<.00011.0000
Height0.755377.69<.00011.0000
Width0.480623.29<.00011.0000

Variable Height will be entered.

Variable(s)
That Have Been
Entered
Height

Multivariate Statistics
StatisticValueF ValueNum DFDen DFPr > F
Wilks' Lambda0.24467077.696151<.0001
Pillai's Trace0.75533077.696151<.0001
Average Squared Canonical Correlation0.125888    


For each removal step (Figure 110.3), the statistics for removal are displayed for all variables currently entered. The variable to be removed at this step (if any) is displayed. If no variable meets the criterion to be removed and the maximum number of steps as specified by the MAXSTEP= option has not been attained, then the procedure continues with another entry step.

Figure 110.3: Step 2: No Variable Is Removed; Variable Length2 Added

Fish Measurement Data

The STEPDISC Procedure
Stepwise Selection: Step 2

Statistics for Removal, DF = 6,
151
VariableR-SquareF ValuePr > F
Height0.755377.69<.0001

No variables can be removed.

Statistics for Entry, DF = 6, 150
VariablePartial
R-Square
F ValuePr > FTolerance
Weight0.738870.71<.00010.4690
Length10.9220295.35<.00010.6083
Length20.9229299.31<.00010.5892
Length30.9173277.37<.00010.5056
Width0.8783180.44<.00010.3699

Variable Length2 will be entered.

Variable(s) That Have
Been Entered
Length2Height

Multivariate Statistics
StatisticValueF ValueNum DFDen DFPr > F
Wilks' Lambda0.018861157.0412300<.0001
Pillai's Trace1.55434987.7812302<.0001
Average Squared Canonical Correlation0.259058    


The stepwise procedure terminates either when no variable can be removed and no variable can be entered or when the maximum number of steps as specified by the MAXSTEP= option has been attained. In this example at step 7 no variables can be either removed or entered (Figure 110.4). Steps 3 through 6 are not displayed in this document.

Figure 110.4: Step 7: No Variables Entered or Removed

Fish Measurement Data

The STEPDISC Procedure
Stepwise Selection: Step 7

Statistics for Removal, DF = 6,
146
VariablePartial
R-Square
F ValuePr > F
Weight0.452120.08<.0001
Length10.298710.36<.0001
Length20.525026.89<.0001
Length30.794894.25<.0001
Height0.725764.37<.0001
Width0.575733.02<.0001

No variables can be removed.


PROC STEPDISC ends by displaying a summary of the steps.

Figure 110.5: Step Summary

No further steps are possible.

Fish Measurement Data

The STEPDISC Procedure

Stepwise Selection Summary
StepNumber
In
EnteredRemovedPartial
R-Square
F ValuePr > FWilks'
Lambda
Pr <
Lambda
Average
Squared
Canonical
Correlation
Pr >
ASCC
11Height 0.755377.69<.00010.24466983<.00010.12588836<.0001
22Length2 0.9229299.31<.00010.01886065<.00010.25905822<.0001
33Length3 0.8826186.77<.00010.00221342<.00010.38427100<.0001
44Width 0.577533.72<.00010.00093510<.00010.45200732<.0001
55Weight 0.446119.73<.00010.00051794<.00010.49488458<.0001
66Length1 0.298710.36<.00010.00036325<.00010.51744189<.0001


All the variables in the data set are found to have potential discriminatory power. These variables are used to develop discrimination models in both the CANDISC and DISCRIM procedure chapters.