Example: Partial Least Squares Regression Analysis

To create this example:
  1. In SAS Studio, click New Options Icon and select New SAS Program.
  2. Create the pentaTrain data set by copying and pasting this code into the Program tab.
    data pentaTrain;
    input obsnam $ S1 L1 P1 S2 L2 P2
    S3 L3 P3 S4 L4 P4
    S5 L5 P5 log_RAI @@;
    n = _n_;
    datalines;
    VESSK -2.6931 -2.5271 -1.2871 3.0777 0.3891 -0.0701
    1.9607 -1.6324 0.5746 1.9607 -1.6324 0.5746
    2.8369 1.4092 -3.1398 0.00
    VESAK -2.6931 -2.5271 -1.2871 3.0777 0.3891 -0.0701
    1.9607 -1.6324 0.5746 0.0744 -1.7333 0.0902
    2.8369 1.4092 -3.1398 0.28
    VEASK -2.6931 -2.5271 -1.2871 3.0777 0.3891 -0.0701
    0.0744 -1.7333 0.0902 1.9607 -1.6324 0.5746
    2.8369 1.4092 -3.1398 0.20
    VEAAK -2.6931 -2.5271 -1.2871 3.0777 0.3891 -0.0701
    0.0744 -1.7333 0.0902 0.0744 -1.7333 0.0902
    2.8369 1.4092 -3.1398 0.51
    VKAAK -2.6931 -2.5271 -1.2871 2.8369 1.4092 -3.1398
    0.0744 -1.7333 0.0902 0.0744 -1.7333 0.0902
    2.8369 1.4092 -3.1398 0.11
    VEWAK -2.6931 -2.5271 -1.2871 3.0777 0.3891 -0.0701
    -4.7548 3.6521 0.8524 0.0744 -1.7333 0.0902
    2.8369 1.4092 -3.1398 2.73
    VEAAP -2.6931 -2.5271 -1.2871 3.0777 0.3891 -0.0701
    0.0744 -1.7333 0.0902 0.0744 -1.7333 0.0902
    -1.2201 0.8829 2.2253 0.18
    VEHAK -2.6931 -2.5271 -1.2871 3.0777 0.3891 -0.0701
    2.4064 1.7438 1.1057 0.0744 -1.7333 0.0902
    2.8369 1.4092 -3.1398 1.53
    VAAAK -2.6931 -2.5271 -1.2871 0.0744 -1.7333 0.0902
    0.0744 -1.7333 0.0902 0.0744 -1.7333 0.0902
    2.8369 1.4092 -3.1398 -0.10
    GEAAK 2.2261 -5.3648 0.3049 3.0777 0.3891 -0.0701
    0.0744 -1.7333 0.0902 0.0744 -1.7333 0.0902
    2.8369 1.4092 -3.1398 -0.52
    LEAAK -4.1921 -1.0285 -0.9801 3.0777 0.3891 -0.0701
    0.0744 -1.7333 0.0902 0.0744 -1.7333 0.0902
    2.8369 1.4092 -3.1398 0.40
    FEAAK -4.9217 1.2977 0.4473 3.0777 0.3891 -0.0701
    0.0744 -1.7333 0.0902 0.0744 -1.7333 0.0902
    2.8369 1.4092 -3.1398 0.30
    VEGGK -2.6931 -2.5271 -1.2871 3.0777 0.3891 -0.0701
    2.2261 -5.3648 0.3049 2.2261 -5.3648 0.3049
    2.8369 1.4092 -3.1398 -1.00
    VEFAK -2.6931 -2.5271 -1.2871 3.0777 0.3891 -0.0701
    -4.9217 1.2977 0.4473 0.0744 -1.7333 0.0902
    2.8369 1.4092 -3.1398 1.57
    VELAK -2.6931 -2.5271 -1.2871 3.0777 0.3891 -0.0701
    -4.1921 -1.0285 -0.9801 0.0744 -1.7333 0.0902
    2.8369 1.4092 -3.1398 0.59
    ;
    Click Submit SAS Code Icon to create the Work.pentaTrain data set.
  3. In the Tasks section, expand the Statistics folder, and then double-click Partial Least Squares Regression. The user interface for the Partial Least Squares Regression task opens.
  4. On the Data tab, select the WORK.PENTATRAIN data set.
    Tip
    If the data set is not available from the drop-down list, click Select a table icon. In the Choose a Table window, expand the library that contains the data set that you want to use. Select the data set for the example and click OK. The selected data set should now appear in the drop-down list.
  5. Assign columns to these roles:
    Role
    Column Name
    Dependent variable
    log_RAI
    Continuous variables
    S1–S5
    L1–L5
    P1–P5
  6. On the Model tab, click Edit Icon. Select all of the variable names in the Variables pane and click Add.
  7. To run the task, click Submit SAS Code Icon.
Here is a subset of the results:
Properties of the Analysis and Percent Variation Accounted for by Partial Least Squares Factors