Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

aovPCAscores

Plot ANOVA-PCA Scores from a Spectra Object


Description

Uses the results from aov_pcaSpectra to conduct PCA and plot the scores. Argument plot is used to select a matrix from those in LM. The residual error matrix is then added to the selected matrix before performing PCA. Use names(LM) to see which factor is stored in which matrix.

Usage

aovPCAscores(spectra, LM, plot = 1, type = "class", choice = NULL, ...)

Arguments

spectra

An object of S3 class Spectra.

LM

List of matrices created by aov_pcaSpectra.

plot

An integer specifying which scores to plot.

type

Either classical ("cls") or robust ("rob"); Results in either c_pcaSpectra or r_pcaSpectra being called on the Spectra object.

choice

The type of scaling to be performed. See c_pcaSpectra and r_pcaSpectra for details.

...

Additional parameters to be passed to plotScores. For example, you can plot confidence ellipses this way. Note that ellipses are drawn based on the groups in spectra$groups, but the separation done by aov_pcaSpectra is based on argument fac. These may not correspond, but you can edit spectra$groups to match if necessary.

Value

Returns the PCA results, and creates the requested plot.

Author(s)

Matthew J. Keinsley and Bryan A. Hanson, DePauw University.

References

Pinto, Bosc, Nocairi, Barros, and Rutledge. "Using ANOVA-PCA for Discriminant Analysis: ..." Analytica Chimica Acta 629.1-2 (2008): 47-55.

Harrington, Vieira, Espinoza, Nien, Romero, and Yergey. "Analysis of Variance–Principal Component Analysis: ..." Analytica Chimica Acta 544.1-2 (2005): 118-27.

See Also

The use of this function can be seen in aov_pcaSpectra. See also plotScores. Additional documentation at https://bryanhanson.github.io/ChemoSpec/


ChemoSpec

Exploratory Chemometrics for Spectroscopy

v5.3.11
GPL-3
Authors
Bryan A. Hanson [aut, cre] (<https://orcid.org/0000-0003-3536-8246>), Mike Bostock [cph, ctb] (author of the d3.js library used by plotSpectraJS, http://d3js.org), Matt Keinsley [ctb] (author of initial AOV-PCA code)
Initial release
2021-03-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.