Description Usage Arguments Details Value References See Also Examples
The function plsrPlot
performs the partial least squares (PLS) regression by using the function plsr
in 'pls' package and draws four kinds of plots
(cross-validation, regression vector, variable importance [selectivity ratio and variable importance in projection], actual vs. predicted value) at once.
1 2 3 4 5 |
formula |
a model formula (see below). |
data |
an optional data frame with the data to fit the model form. |
testdata |
data set for prediction. |
ncomp |
the number of components (latent variables) to include in the model (see below). |
maxcomp |
Maximum number of components (latent variables) to be used for cross-validation. |
plot |
if |
output |
if |
dir |
path to the directory where the results are output (default value is |
return.stats |
if |
... |
additional arguments passed to the |
The formula
argument should be a symbolic formula of the form response ~ terms
,
where response
is the name of the response vector
and terms
is the name of the predictor matrix, e.g., water ~ FTIR.
See plsr
for a detailed description.
If ncomp = "auto"
, the optimum number of components is automatically selected (see ncompopt
).
If return.stats = TRUE
, an object of class data.frame
containing the statistics of PLS regression is returned.
Otherwise, an object of class mvr
is returned (see plsr
).
Vignette https://www.gitbook.com/book/uwadaira/plsropt_vignette_ver1-2-0
1 2 | # alternative way
result <- plsrPlot(yTrain = datTrain$Brix, xTrain = datTrain$NIR, yTest=datTest$Brix, xTest=datTest$NIR)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.