The HPPLS Procedure

Selecting the Number of Factors by Test Set Validation

A PLS model is not complete until you choose the number of factors. You can choose the number of factors by using test set validation, in which the data set is divided into two groups called the training data and test data. You fit the model to the training data, and then you check the capability of the model to predict responses for the test data. The predicted residual sum of squares (PRESS) statistic is based on the residuals that are generated by this process.

To select the number of extracted factors by test set validation, you use the PARTITION statement to specify how observations in the input data set are logically divided into two subsets for model training and testing. For example, you can designate a variable in the input data set and a set of formatted values of that variable to determine the role of each observation, as in the following SAS statements:

proc hppls data=sample;
   model ls ha dt = v1-v27;
   partition roleVar = Role(train='TRAIN' test='TEST');
run;

The resulting output is shown in Figure 58.4 through Figure 58.6.

Figure 58.4: Model Information and Number of Observations with Test Set Validation

The HPPLS Procedure

Model Information
Data SourceWORK.SAMPLE
Factor Extraction MethodPartial Least Squares
PLS AlgorithmNIPALS
Validation MethodTest Set Validation

Number of Observations Read16
Number of Observations Used16
Number of Observations Used for Training9
Number of Observations Used for Testing7


Figure 58.5: Test-Set-Validated PRESS Statistics for Number of Factors

The HPPLS Procedure

Test Set Validation for
the Number of Extracted
Factors
Number of
Extracted
Factors
Root
Mean
PRESS
01.426362
11.276694
21.181752
30.656999
40.43457
50.420916
60.585031
70.576586
80.563935
90.563935

Minimum Root Mean PRESS0.420916
Minimizing Number of Factors5


Figure 58.6: PLS Variation Summary for Test-Set-Validated Model

Percent Variation Accounted for by Partial Least Squares Factors
Number of
Extracted
Factors
Model EffectsDependent Variables
CurrentTotalCurrentTotal
195.9249595.9249537.2707137.27071
23.8640799.7890332.3816769.65238
30.1017099.8907320.7688290.42120
40.0897999.980524.6666695.08787
50.0114299.991943.8818498.96971


In Figure 58.4, the "Model Information" table indicates that test set validation is used. The "Number of Observations" table shows that nine sample observations are assigned for training roles and seven are assigned for testing roles.

Figure 58.5 provides details about the results from test set validation. These results show that the absolute minimum PRESS is achieved with five extracted factors. Notice, however, that this is not much smaller than the PRESS for three factors. By using the CVTEST option, you can perform a statistical model comparison that is suggested by Van der Voet (1994) to test whether this difference is significant, as shown in the following SAS statements:

proc hppls data=sample cvtest(pval=0.15 seed=12345);
   model ls ha dt = v1-v27;
   partition roleVar = Role(train='TRAIN' test='TEST');
run;

The model comparison test is based on a rerandomization of the data. By default, the seed for this randomization is based on the system clock, but it is specified here. The resulting output is presented in Figure 58.7 through Figure 58.9.

Figure 58.7: Model Information with Model Comparison Test

The HPPLS Procedure

Model Information
Data SourceWORK.SAMPLE
Factor Extraction MethodPartial Least Squares
PLS AlgorithmNIPALS
Validation MethodTest Set Validation
Validation Testing CriterionProb T**2 > 0.15
Number of Random Permutations1000
Random Number Seed for Permutation12345


Figure 58.8: Testing Test Set Validation for Number of Factors

The HPPLS Procedure

Test Set Validation for the Number
of Extracted Factors
Number of
Extracted
Factors
Root
Mean
PRESS
T**2Prob >
T**2
01.4263625.1916290.0650
11.2766946.174825<.0001
21.1817524.602030.0780
30.6569993.099990.5200
40.434574.9802270.0970
50.42091601.0000
60.5850312.054960.7420
70.5765863.0091720.4960
80.5639352.4166350.7500
90.5639352.4166350.7490

Minimum Root Mean PRESS0.420916
Minimizing Number of Factors5
Smallest Number of Factors with p > 0.153


Figure 58.9: PLS Variation Summary for Tested Test-Set-Validated Model

Percent Variation Accounted for by Partial Least Squares Factors
Number of
Extracted
Factors
Model EffectsDependent Variables
CurrentTotalCurrentTotal
195.9249595.9249537.2707137.27071
23.8640799.7890332.3816769.65238
30.1017099.8907320.7688290.42120


The "Model Information" table in Figure 58.7 displays information about the options that are used in the model comparison test. In Figure 58.8, the p-value in comparing the test-set validated residuals from models that have five and three factors indicates that the difference between the two models is insignificant; therefore, the model with fewer factors is preferred. The variation summary in Figure 58.9 shows that more than 99% of the predictor variation and more than 90% of the response variation are accounted for by the three factors.