rediduals-methods {pcaMethods} | R Documentation

## Residuals values from a PCA model.

### Description

This function extracts the residuals values from a pcaRes object for the PCA methods SVD, Nipals, PPCA and BPCA

### Usage

    ## S3 method for class 'pcaRes'
    residuals(object, data = completeObs(object), ...)

    ## S4 method for signature 'pcaRes'
    residuals(object, data = completeObs(object), ...)

    ## S4 method for signature 'pcaRes'
    resid(object, data = completeObs(object), ...)

### Arguments

`object` | `pcaRes` the `pcaRes` object of interest.
`data` | `matrix` The data that was used to calculate the PCA model (or a different dataset to e.g. adress its proximity to the model).
`...` | Passed on to `predict.pcaRes`. E.g. setting the number of used components.

### Value

A `matrix` with the residuals

### Author(s)

Henning Redestig

### Examples

    data(iris)
    pcIr <- pca(iris[,1:4])
    head(residuals(pcIr, iris[,1:4]))

[Package pcaMethods version 1.84.0 Index]