pls (version 2.8-3)

scores: Extract Scores and Loadings from PLSR and PCR Models

Description

These functions extract score and loading matrices from fitted mvr models.

Usage

loadings(object, ...)

# S3 method for default loadings(object, ...)

scores(object, ...)

# S3 method for default scores(object, ...)

Yscores(object)

loading.weights(object)

Yloadings(object)

Value

A matrix with scores or loadings.

Arguments

object

a fitted model to extract from.

...

extra arguments, currently not used.

Author

Ron Wehrens and Bjørn-Helge Mevik

Details

All functions extract the indicated matrix from the fitted model, and will work with any object having a suitably named component.

The default scores and loadings methods also handle prcomp objects (their scores and loadings components are called x and rotation, resp.), and add an attribute "explvar" with the variance explained by each component, if this is available. (See explvar for details.)

See Also

mvr, coef.mvr

Examples

Run this code

data(yarn)
plsmod <- plsr(density ~ NIR, 6, data = yarn)
scores(plsmod)
loadings(plsmod)[,1:4]

Run the code above in your browser using DataCamp Workspace