PLSMOD 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 table 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 to logically divide observations in the input data table into two subsets for model training and testing. For example, you can designate a variable in the input data table and a set of formatted values of that variable to determine the role of each observation, as in the following SAS statements:

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

The resulting output is shown in Figure 3 through Figure 5.

Figure 3: Model Information, Dimensions, and Number of Observations with Test Set Validation

The PLSMOD Procedure

Model Information
Data SourceSAMPLE
Factor Extraction MethodPartial Least Squares
PLS AlgorithmNIPALS
Validation MethodTest Set Validation

Dimensions
Number of Response Variables3
Number of Effects27
Number of Predictor Parameters27
Maximum Number of Factors9

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


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

The PLSMOD 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 5: PLS Variation Summary for Test-Set-Validated Model

Percentage Variation Accounted for by Partial Least Squares Factors
Number of
Extracted
Factors
Model EffectsResponse 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 3, the "Model Information" table indicates that test set validation is used. The "Dimensions" table shows that the maximum number of factors to extract is nine. The "Number of Observations" table shows that nine sample observations are assigned for training roles and seven are assigned for testing roles.

Figure 4 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 plsmod data=mylib.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 6 through Figure 8.

Figure 6: Model Information with Model Comparison Test

The PLSMOD Procedure

Model Information
Data SourceSAMPLE
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 7: Testing Test Set Validation for Number of Factors

The PLSMOD Procedure

Test Set Validation for the Number
of Extracted Factors
Number of
Extracted
Factors
Root
Mean
PRESS
T**2Prob >
T**2
01.4263625.1916290.0480
11.2766946.174825<.0001
21.1817524.602030.0620
30.6569993.099990.5400
40.434574.9802260.0960
50.42091601.0000
60.5850312.054960.7470
70.5765863.0091720.4980
80.5639352.4166350.7500
90.5639352.4166350.7500

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


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

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


The "Model Information" table in Figure 6 displays information about the options that are used in the model comparison test. In Figure 7, 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 8 shows that more than 99% of the predictor variation and more than 90% of the response variation are accounted for by the three factors.

Last updated: September 22, 2026