Skip to contents

This is a quite general and flexible implementation of ASCA.

Usage

asca(formula, data, contrasts = "contr.sum", ...)

Arguments

formula

Model formula accepting a single response (block) and predictors. See Details for more information.

data

The data set to analyse.

contrasts

Effect coding: "sum" (default = sum-coding), "weighted", "reference", "treatment".

...

Additional arguments to asca_fit.

Value

An asca object containing loadings, scores, explained variances, etc. The object has associated plotting (asca_plots) and result (asca_results) functions.

Details

ASCA is a method which decomposes a multivariate response according to one or more design variables. ANOVA is used to split variation into contributions from factors, and PCA is performed on the corresponding least squares estimates, i.e., Y = X1 B1 + X2 B2 + ... + E = T1 P1' + T2 P2' + ... + E. This version of ASCA encompasses variants of LiMM-PCA, generalized ASCA and covariates ASCA. It includes confidence ellipsoids for the balanced crossed-effect ASCA.

The formula interface is extended with the function r() to indicate random effects and comb() to indicate effects that should be combined. See Examples for use cases.

References

  • Smilde, A., Jansen, J., Hoefsloot, H., Lamers,R., Van Der Greef, J., and Timmerman, M.(2005). ANOVA-Simultaneous Component Analysis (ASCA): A new tool for analyzing designed metabolomics data. Bioinformatics, 21(13), 3043–3048.

  • Liland, K.H., Smilde, A., Marini, F., and Næs,T. (2018). Confidence ellipsoids for ASCA models based on multivariate regression theory. Journal of Chemometrics, 32(e2990), 1–13.

  • Martin, M. and Govaerts, B. (2020). LiMM-PCA: Combining ASCA+ and linear mixed models to analyse high-dimensional designed data. Journal of Chemometrics, 34(6), e3232.

See also

Main methods: asca, apca, limmpca, msca, pcanova, prc and permanova. Workhorse function underpinning most methods: asca_fit. Extraction of results and plotting: asca_results, asca_plots, pcanova_results and pcanova_plots

Examples

# Load candies data
data(candies)

# Basic ASCA model with two factors
mod <- asca(assessment ~ candy + assessor, data=candies)
print(mod)
#> Anova Simultaneous Component Analysis fitted using 'lm' (Linear Model)
#> Call:
#> asca(formula = assessment ~ candy + assessor, data = candies)

# ASCA model with interaction
mod <- asca(assessment ~ candy * assessor, data=candies)
print(mod)
#> Anova Simultaneous Component Analysis fitted using 'lm' (Linear Model)
#> Call:
#> asca(formula = assessment ~ candy * assessor, data = candies)

# Result plotting for first factor
loadingplot(mod, scatter=TRUE, labels="names")

scoreplot(mod)

# No backprojection
scoreplot(mod, projections=FALSE)

# Spider plot
scoreplot(mod, spider=TRUE, projections=FALSE)


# ASCA model with compressed response using 5 principal components
mod.pca <- asca(assessment ~ candy + assessor, data=candies, pca.in=5)

# Mixed Model ASCA, random assessor
mod.mix <- asca(assessment ~ candy + r(assessor), data=candies)
scoreplot(mod.mix)


# Mixed Model ASCA, REML estimation
mod.mix <- asca(assessment ~ candy + r(assessor), data=candies, REML=TRUE)
scoreplot(mod.mix)


# Load Caldana data
data(caldana)

# Combining effects in ASCA
mod.comb <- asca(compounds ~ time + comb(light + time:light), data=caldana)
summary(mod.comb)
#> Anova Simultaneous Component Analysis fitted using 'lm' (Linear Model) 
#> - SS type II,  coding, restricted model, least squares estimation 
#>                  Sum.Sq. Expl.var.(%)
#> time              154.58         9.69
#> light+light:time  349.64        21.92
#> Residuals        1091.14        68.39
timeplot(mod.comb, factor="light", time="time", comb=2)


# Permutation testing
mod.perm <- asca(assessment ~ candy * assessor, data=candies, permute=TRUE)
summary(mod.perm)
#> Anova Simultaneous Component Analysis fitted using 'lm' (Linear Model) 
#> - SS type II,  coding, restricted model, least squares estimation, 1000 permutations 
#>                 Sum.Sq. Expl.var.(%) p-value
#> candy          33416.66        74.48       0
#> assessor        1961.37         4.37       0
#> assessor:candy  3445.73         7.68       0
#> Residuals       6043.52        13.47      NA