pcr.model {pls.pcr} | R Documentation |
PCR model building
Description
Function does the actual model building in PCR
regression. Y is regressed on Principal Component scores.
This function should not be called directly: the pcr
function is meant for that.
Usage
pcr.model(X, Y, ncomp, newX)
Arguments
X |
a matrix of observations. NA s and Inf s are not
allowed. |
Y |
a vector or matrix of responses. NA s and Inf s
are not allowed. |
ncomp |
the number of latent variables to be used in the
modelling. The default number of latent variables is the smallest of
the number of objects or the number of variables in X . |
newX |
optional new measurements: if present, predictions will be
made for them. |
Value
A list containing the following components is returned:
B |
an array of regression coefficients for all items in
ncomp . The dimensions of B are
c(nvar, npred, length(ncomp)) with nvar the number
of X variables and npred the number of variables to be
predicted in Y . |
XvarExpl |
coeff. of determination (X ). |
Ypred |
predictions for newX (if asked). |
See Also
mvr
pcr