Description Usage Arguments Details Value Author(s) References See Also Examples
A simple partial least squares procedure.
1 2 3 4 5 6 7 8 9 10 11 12 13 
x 
The covariate matrix, in either 
y 
The response vector. 
K 
The number of desired PLS directions. In plotting, this can be a vector of directions to draw, otherwise directions 
scale 
An indicator for whether to scale 
verb 
Whether or not to print a small progress script. 
object 
For 
newdata 
For 
type 
For 
xlab 
For 
ylab 
For 
... 
Additional arguments. 
pls
fits the Partial Least Squares algorithm described in Taddy (2012; Appendix A.1).
In particular, we obtain loadings loadings[,k]
as the correlation between
X
and factors factors[,k]
, where factors[,1]
is initialized
at scale(as.numeric(y))
and subsequent factors are orthogonal to
to the k'th pls direction, an orthonormal transformation of x%*%loadings[,k]
.
predict.pls
returns predictions from the object$fwdmod
forward regression α + β*z for projections z = x*loadings 
shift
derived from new covariates, or if type="reduction"
it just returns these projections.
summary.pls
prints dimension details and a quick summary of the
corresponding forward regression. plot.pls
draws response
versus fitted values for leastsquares fit onto the K pls directions.
Output from pls
is a list with the following entries
y 
The response vector. 
x 
The unchanged covariate matrix. 
directions 
The pls directions: 
loadings 
The pls loadings. 
shift 
Shift applied after projection to center the PLS directions. 
fitted 

fwdmod 
The 
predict.pls
outputs either a vector of predicted resonse or an nrow(newcounts)
by ncol(object$loadings)
matrix of pls directions for each new observation. Summary and plot produce return nothing.
Matt Taddy taddy@chicagobooth.edu
Taddy (2013), Multinomial Inverse Regression for Text Analysis. Journal of the American Statistical Association 108.
Wold, H. (1975), Soft modeling by latent variables: The nonlinear iterative partial least squares approach. In Perspectives in Probability and Statistics, Papers in Honour of M.S. Bartlett.
normalize, sdev, corr, congress109
1 2 3 4 5  data(congress109)
x < t( t(congress109Counts)/rowSums(congress109Counts) )
summary( fit < pls(x, congress109Ideology$repshare, K=3) )
plot(fit, pch=21, bg=c(4,3,2)[congress109Ideology$party])
predict(fit, newdata=x[c(68,388),])

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.