# CEPlot: Cumulative eigenvalue plot In PCADSC: Tools for Principal Component Analysis-Based Data Structure Comparisons

## Description

Produce a cumulative eigenvalue (CE) plot from a full or partial `PCADSC` object, as obtained from a call to `PCADSC`. In either case, this `PCADSC` object must have a non-`NULL` `CEInfo` slot (see examples). The CE plot compares the eigenvalues obtained from PCA performed separately and jointly on two datasets that consist of different observations of the same variables.

## Usage

 `1` ```CEPlot(x, nDraw = NULL) ```

## Arguments

 `x` x A `PCADSC` or `angleInfo` object, as produced by `PCADSC` or `doAngle`, respectively. `nDraw` A positive integer. The number of simulated cumulative eigenvalue curves that should be added to the plot.

## Details

In the x-coordinates, cumulative differences in eigenvalues are shown, while the y-coordinates are the cumulative sum of the joint eigenvalues. The plot is annotated with Kolmogorov-Smirnov and Cramer-von Mises tests evaluated by permutation tests, testing the null hypothesis of no difference in eigenvalues. The plot also features a number of cumulative simulated cumulative eigenvalue curves as dashed lines. Moreover, a shaded area presents pointwise 95 % confidence bands for the cumulative difference, also obtained using the permutation test.

`PCADSC`, `doCE`
 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27``` ```#load iris data data(iris) #Define grouping variable, grouping the observations by whether their species is #Setosa or not iris\$group <- "setosa" iris\$group[iris\$Species != "setosa"] <- "non-setosa" iris\$Species <- NULL ## Not run: #make a PCADSC object, splitting the data by "group" irisPCADSC <- PCADSC(iris, "group") #make a partial PCADSC object from iris and fill out CEInfo in the next call irisPCADSC2 <- PCADSC(iris, "group", doCE = FALSE) irisPCADSC2 <- doCE(irisPCADSC2) #make a CE plot CEPlot(irisPCADSC) CEPlot(irisPCADSC2) ## End(Not run) #Only do CE information and use less resamplings for a faster runtime irisPCADSC_fast <- PCADSC(iris, "group", doAngle = FALSE, doChroma = FALSE, B = 1000) CEPlot(irisPCADSC_fast) ```