Description Usage Arguments Details Value Note Author(s) References See Also Examples

ASCA does PCA on the averages of the treatment levels for an experimental design.

1 2 |

`data` |
numeric data matrix that is to be analyzed with ASCA. Variables are represented by columns, observations by rows. |

`levels` |
numeric matrix describing the experimental design. Each factor is represented by a column. The elements of the columns give the treatment level the row belongs to. |

`equation.elements` |
a string value indicating which factors and interactions are to be part of the ASCA analysis. A factor is defined by writing its column number in the 'levels' matrix (eg. "1") and an interaction by combining the interacting factors' column numbers from the 'levels' matrix (eg. "123"). Multiple factors/interactions are seperated with comma's (eg. "1,2,12"). |

`scaling` |
boolean; determines autoscaling of the data. Default is FALSE, data is not auto-scaled. |

`only.means.matrix` |
boolean; if TRUE, only the matrix with averages for the treatment levels is returned. Default is FALSE. (Note: this is generally only used for performance optimization during many runs, such as permutation testing) |

`use.previous.asca` |
previous ASCA results can be used for some calculations that are independent of the data values. Useful for permutation testing. Default is NULL, do not use previous results. |

ASCA decomposes a data matrix X in effect matrices A, B, ... containing the level averages for each treatment level, interaction matrices U, V, ... between two or more factors and a residual matrix E with data that is not represented by the model: X = A + B + ... + U + V + ... + E. Principal component analysis is then used as a variable reduction method on each of the effect and interaction matrices. Scores, loadings and singular values for each factor and each interaction are returned.

PerformAsca returns a list with the following components:

`data ` |
original data matrix. |

`levels ` |
original matrix with treatment levels. |

`svd ` |
an SVD performed on all elements in "equation.elements" using this package's custom PCA.Calculate. |

`remainder ` |
residual matrix. |

`ee.names ` |
string array containing the factors and interactions that were used in this ASCA (i.e. "equation.elements") |

All remaining list elements (eg. "1", "12") correspond to a separate factor or interaction. Each is a list containing the ASCA results with the following elements:

`factors.evaluated ` |
numerical array of the relevant factor (or multiple factors for an interactions) |

`level.combinations ` |
contains all information on which combinations of factor-levels occur in the data (row.patterns) and, for each combination, lists the row-indices where it occurs |

`means.matrix ` |
the matrix with means of the treatment levels |

`reduced.matrix ` |
values left after the (already reduced by previously calculated factors/interactions). The data matrix is reduced by this factor/interaction's means matrix |

`svd ` |
a SVD performed on this factor/interaction's means matrix using PCA.Calculate |

ASCA.Calculate uses the custom method "PCA.Calculate" (part of MetStaT package) for the principal component analysis.

Tim Dorscheidt, Gooitzen Zwanenburg

Smilde AK, Jansen JJ, Hoefsloot HCJ, Lamers R JAN, van der Greef J,
Timmerman ME. *ANOVA simultaneous component analysis (ASCA):
a new tool for analyzing designed metabolomics data*. Bioinformatics
**21**, (2005), p. 3043 - 3048.

Gooitzen Zwanenburg, Huub C.J. Hoefsloot, Johan A. Westerhuis,
Jeroen J. Jansen and Age K. Smilde, *ANOVA principal component analysis and
ANOVA simultaneous component analysis: a comparison*. J Chemometrics, **25**,
(2011), p. 561 - 567

`ASCA.DoPermutationTest`

, `PCA.Calculate`

1 2 3 4 5 6 |

```
Loading required package: MASS
Loading required package: abind
Loading required package: pls
Attaching package: 'pls'
The following object is masked from 'package:stats':
loadings
Variance explained per principal component (if >1%):
Whole data set PC1: 51.53% PC2: 32.27% PC3: 16.03%
Factor 1 PC1: 100.00% PC2: NA% PC3: NA%
Factor 2 PC1: 91.10% PC2: 8.90% PC3: NA%
Interaction 12 PC1: 92.22% PC2: 7.78% PC3: NA%
Percentage each effect contributes to the total sum of squares:
Overall means 99.39%
Factor 1 0.19%
Factor 2 0.05%
Interaction 12 0.03%
Residuals 0.34%
Percentage each effect contributes to the sum of squares of the centered data:
Factor 1 31.11%
Factor 2 8.74%
Interaction 12 5.08%
Residuals 55.07%
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.