Learn R Programming

mvdalab (version 1.4)

XresidualContrib: Generates the squared prediction error contributions and contribution plot

Description

Generates the squared prediction error (SPE) contributions and graph both mvdareg and mvdapca objects.

Usage

XresidualContrib(object, ncomp = object$ncomp, obs1 = 1)

Arguments

object

an object of class mvdareg or mvdapca.

ncomp

the number of components to include in the SPE calculation.

obs1

the observaion in SPE assessment.

Value

The output of XresidualContrib is a matrix of score contributions for a specified observation and the corresponding graph.

Details

XresidualContrib is used to generates the squared prediction error (SPE) contributions and graph for both PLS and PCA models. Only one observation at a time is supported.

References

MacGregor, Process Monitoring and Diagnosis by Multiblock PLS Methods, May 1994 Vol. 40, No. 5 AIChE Journal

Examples

Run this code
# NOT RUN {
data(Penta)
mod1 <- plsFit(log.RAI ~., scale = TRUE, data = Penta[, -1],
               ncomp = 2, validation = "loo")
XresidualContrib(mod1, ncomp = 2, obs1 = 3)

# }
# NOT RUN {
#PCA Model
pc1 <- pcaFit(Penta[, -1], ncomp = 4)
XresidualContrib(pc1, ncomp = 3, obs1 = 3)
# }

Run the code above in your browser using DataLab