mrCA | R Documentation |
This functions performs a multiple-response Correspondence Analysis (MR-CA) as defined in Mahieu, Schlich, Visalli, and Cardot (2021)
mrCA(
data,
proj.row = NULL,
proj.row.obs = NULL,
proj.col = NULL,
ellipse = FALSE,
nboot = 2000,
nbaxes.sig = Inf
)
data |
A data.frame of observations in rows whose first column is a factor (the categories) and subsequent columns are binary numeric or integer, each column being a response option |
proj.row |
Optional. A contingency table with new categories to be projected as supplementary rows within the MR-CA space in rows and the same response options as data in columns |
proj.row.obs |
A numeric vector whose length equals nrow(proj.row) and giving the number of observations within each projected rows. Useless if proj.row=NULL |
proj.col |
Optional. A contingency table with new response options to be projected as supplementary columns within the MR-CA space in columns and the same categories as data in rows |
ellipse |
Logical. Are confidence ellipses for the categories to be computed? Default is FALSE. See details |
nboot |
Number of virtual datasets used in the total bootsrap procedure. Useless when ellipse=FALSE. See details |
nbaxes.sig |
The number of significant axes retuned by |
ellipse: When ellipse=TRUE, confidence ellipses for the categories are computed using a total bootstrap procedure (Cadoret & Husson, 2013). nboot virtual datasets are generated by randomly sampling with replacement response vectors within each category. A MR-CA is then performed on these virtual dataset and the resulting virtual configurations are adjusted to the actual configuration using Procrustes rotations accounting for nbaxes.sig axes (Mahieu, Schlich, Visalli, & Cardot, 2021). Finally, for each category, a confidence ellipse is constructed using the position of its bootstrap replicates. The ellipses are plotted when using plot.mrCA
Pairwise total bootstrap tests as proposed in Castura et al. (2023) are also performed between the categories.
A list with the following elements:
Eigenvalues and their corresponding percentages of inertia
Rows coordinates
Columns coordinates
Projected rows coordinates
Projected columns coordinates
Results of the singular value decomposition
Coordinates of the rotated bootstrap replicates
P-values of the pairwise total bootstrap tests
Mahieu, B., Schlich, P., Visalli, M., & Cardot, H. (2021). A multiple-response chi-square framework for the analysis of Free-Comment and Check-All-That-Apply data. Food Quality and Preference, 93.
Loughin, T. M., & Scherer, P. N. (1998). Testing for Association in Contingency Tables with Multiple Column Responses. Biometrics, 54(2), 630-637.
Cadoret, M., & Husson, F. (2013). Construction and evaluation of confidence ellipses applied at sensory data. Food Quality and Preference, 28(1), 106-115.
Castura, J. C., Varela, P., & Næs, T. (2023). Evaluation of complementary numerical and visual approaches for investigating pairwise comparisons after principal component analysis. Food Quality and Preference, 107.
nb.obs=200
nb.response=5
nb.category=5
vec.category=paste("C",1:nb.category,sep="")
right=matrix(rbinom(nb.response*nb.obs,1,0.25),nb.obs,nb.response)
category=sample(vec.category,nb.obs,replace = TRUE)
dset=cbind.data.frame(category,right)
dset$category=as.factor(dset$category)
res=mrCA(dset)
plot(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.