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.
Details
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.
Value
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
Note
ASCA.Calculate uses the custom method "PCA.Calculate" (part of MetStaT package) for the principal component analysis.
Author(s)
Tim Dorscheidt, Gooitzen Zwanenburg
References
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
See Also
ASCA.DoPermutationTest, PCA.Calculate
Examples
## use the data matrix, 'ASCAX', and an experimental design matrix, 'ASCAF'
data(ASCAdata)
ASCA <- ASCA.Calculate(ASCAX, ASCAF, equation.elements = "1,2,12", scaling = FALSE)
## plot the results
ASCA.Plot(ASCA)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(MetStaT)
Loading required package: MASS
Loading required package: abind
Loading required package: pls
Attaching package: 'pls'
The following object is masked from 'package:stats':
loadings
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/MetStaT/ASCA.Calculate.Rd_%03d_medium.png", width=480, height=480)
> ### Name: ASCA.Calculate
>
> ### Title: ASCA method (ANOVA-simultaneous component analysis)
> ### Aliases: ASCA.Calculate
> ### Keywords: ASCA PCA
>
> ### ** Examples
>
> ## use the data matrix, 'ASCAX', and an experimental design matrix, 'ASCAF'
> data(ASCAdata)
> ASCA <- ASCA.Calculate(ASCAX, ASCAF, equation.elements = "1,2,12", scaling = FALSE)
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%
>
> ## plot the results
> ASCA.Plot(ASCA)
>
>
>
>
>
> dev.off()
null device
1
>