CDA consists in two steps: building a correspondence analysis (CA) on X, then using row coordinates on all CA components as input variables for a linear discriminant analysis. CDA.test builds the intermediate CA, then uses the first ncomp components to test for an effect of fact. If 1 component is used the test is an ANOVA, if more than 1 component are used the test is a MANOVA.