msca {HDANOVA} | R Documentation |
Multilevel Simultaneous Component Analysis - MSCA
Description
This MSCA implementation assumes a single factor to be used as between-individuals factor.
Usage
msca(
formula,
data,
contrasts = "contr.sum",
permute = FALSE,
perm.type = c("approximate", "exact"),
...
)
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". |
permute |
Number of permutations to perform (default = 1000). |
perm.type |
Type of permutation to perform, either "approximate" or "exact" (default = "approximate"). |
... |
Additional arguments to |
Value
An asca
object containing loadings, scores, explained variances, etc. The object has
associated plotting (asca_plots
) and result (asca_results
) functions.
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.
See Also
Main methods: asca
, apca
, limmpca
, msca
, pcanova
, prc
and permanova
.
Workhorse function underpinning most methods: hdanova
.
Extraction of results and plotting: asca_results
, asca_plots
, pcanova_results
and pcanova_plots
Examples
# Load candies data
data(candies)
# Basic MSCA model with a single factor
mod <- msca(assessment ~ candy, data=candies)
print(mod)
summary(mod)
# Result plotting for first factor
loadingplot(mod, scatter=TRUE, labels="names")
scoreplot(mod)
# Within scores
scoreplot(mod, factor="within")
# Within scores per factor level
par.old <- par(mfrow=c(3,2), mar=c(4,4,2,1), mgp=c(2,0.7,0))
for(i in 1:length(mod$scores.within))
scoreplot(mod, factor="within", within_level=i,
main=paste0("Level: ", names(mod$scores.within)[i]),
panel.first=abline(v=0,h=0,col="gray",lty=2))
par(par.old)
# Permutation testing
mod.perm <- asca(assessment ~ candy * assessor, data=candies, permute=TRUE)
summary(mod.perm)