Type of Tool  RFunction 
Title  Multivariate Partial Least Squares (R) 
Programmer/Email  Danh Nguyen 
Contributing Site  Davis 
Description  This function computes the K PLS components based on X & Y matrices and associated quantities. Y can be a vector or a matrix of multiple responses. 
Classification Graph Type 

References 
SAS Institute Inc. (1999). The PLS procedure. SAS/STAT User's Guide, Version 8, Cary, NC, pp. 26932734. Wold, S. (1994). PLS for multivariate linear modeling. In Waterbeemed, H. (ed), Chemometric Methods in Molecular Design, VerlagChemie, Germany, pp. 195218. 
Datasets 

Data 

Software Program  R 
Software  R 
Macro Parameters 
Input argument(s) X_s Matrix of predictors (genes)standardized to mean 0 variance 1 variance 1 ("training X" of size n x p). Y_s Matrix (or vector) of responses Y_salso standardized ("training Y" of size nxL). X_ps Matrix of predictor values (test/validation X) to construct test components, X_ps (of size mxp). lv The number of PLS components (lv). Return(s): T1 n x lv matrix of PLS training components based on training information. T2 m x lv matrix of PLS test components contructed from training information. PVEX 1 x lv vector of cummulative percent of Xvariation explained. PVEY 1 x lv vector of cummulative percent of Yvariation explained. W p x lv matrix of Xweights. B p x 1 vector of "regression coefficients". V p x 1 vector of linear combination of sum of squares of Xweights This is the so called 'VIP' (variable influence on projection) (Wold 1994; SAS Institue Inc., 1999). 
RCode  Attachment  Davis_Partial Least Squares_R Function 
RCode 

SASCode  Attachment 

SASCode 

StataCode  Attachment 

StataCode 

Other Code  Attachment 

Other Code 

Called Data Manipulation 

Called Tool/Utility 

Called Checking Macro 

Called Other 

CreationDate 

RevisionDate 

Example Code 

Example Output 

SAS Examples 

SAS_Example_Code 

SAS_Example_Output 

R Examples 

R_Example_Code 

R_Example_Output 

Stats Examples 

Special Features 

Special Features Attached 

Special Features Text 

Notes1Legend  Section with calls to needed macros 
Notes1 

Notes2Legend  Macro call with fully specified parameters 
Notes2 

Notes3Legend  Section with definitions of global macro parameters 
Notes3 

Notes4Legend  Section with definitions of local macro variables 
Notes4 

See Also 
Partial Least Squares Research Topic Partial Least Squares SAS 
Checklists 

Stat Tools Disclaimer 
History: Date/Last Modified: 10.28.01/07.19.01 (Danh V. Nguyen), Matlab code. Translated to R in 2007 (Ying Chen). Full testing of exact correspondence of results to Matlab, R and SAS 08.14.08 (D.V. Nguyen). 
Discliamer 
The views expressed within CTSpedia are those of the author and must not be taken to represent policy or guidance on the behalf of any organization or institution with which the author is affiliated. 
Permission 
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT OLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
Reference Image 
