Learn R Programming

ChemoSpec (version 3.0-1)

aovPCA: ANOVA-PCA Analysis of Spectra Data

Description

ANOVA-PCA is a combination of both methods developed by Harrington. The data is partitioned into submatrices corresponding to each experimental factor, which are then subjected to PCA separately after adding the residual error back. If the effect of a factor is large compared to the residual error, separation along the 1st PC in the score plot should be evident. With this method, the significance of a factor can be visually determined. (ANOVA-PCA is not blind to group membership.)

Usage

aovPCA(spectra, fac)

Arguments

spectra
An object of S3 class Spectra
fac
A vector of character strings giving the factors to be used in the analysis. These should be elements of Spectra. Note that there should be 2 or more factors, because ANOVA-PCA on one factor is the same a

Value

  • A list of matrices for each factor and their interactions, along with the residual error and mean centered data matrix.

Details

ANOVA-PCA with only one factor is the same as standard PCA and gives no additional separation.

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.

https://github.com/bryanhanson/ChemoSpec

See Also

This function calls avgFacLvls, and the results are used in aovPCAscores and aovPCAloadings.

Examples

Run this code
data(CuticleIR)
# Create new groups from existing groups
# These are used as the factors
n.groups <-list(genotype = c("G", "T"), treatment = c("C", "E"))
NewIR <- splitSpectraGroups(CuticleIR, n.groups)
# run aovPCA
mats <-aovPCA(NewIR, fac = c("genotype", "treatment"))
apca1 <- aovPCAscores(NewIR, mats, plot = 1, main = "aovPCA: Genotype")
apca2 <- aovPCAscores(NewIR, mats, plot = 2, main = "aovPCA: Treatment")
apca3 <- aovPCAscores(NewIR, mats, plot = 3, main = "aovPCA: Genotype x Treatment")
apca5 <- aovPCAloadings(spectra = NewIR, LM = mats, pca = apca1, main = "aovPCA: Genotype Loadings")

Run the code above in your browser using DataLab