Learn R Programming

ade4 (version 1.7-19)

dudi.mix: Ordination of Tables mixing quantitative variables and factors

Description

performs a multivariate analysis with mixed quantitative variables and factors.

Usage

dudi.mix(df, add.square = FALSE, scannf = TRUE, nf = 2)

Value

Returns a list of class mix and dudi (see dudi) containing also

index

a factor giving the type of each variable : f = factor, o = ordered, q = quantitative

assign

a factor indicating the initial variable for each column of the transformed table

cr

a data frame giving for each variable and each score:
the squared correlation coefficients if it is a quantitative variable
the correlation ratios if it is a factor
the squared multiple correlation coefficients if it is ordered

Arguments

df

a data frame with mixed type variables (quantitative, factor and ordered)

add.square

a logical value indicating whether the squares of quantitative variables should be added

scannf

a logical value indicating whether the eigenvalues bar plot should be displayed

nf

if scannf FALSE, an integer indicating the number of kept axes

Author

Daniel Chessel
Anne-Béatrice Dufour anne-beatrice.dufour@univ-lyon1.fr

Details

If df contains only quantitative variables, this is equivalent to a normed PCA.
If df contains only factors, this is equivalent to a MCA.
Ordered factors are replaced by poly(x,deg=2).

This analysis generalizes the Hill and Smith method.
The principal components of this analysis are centered and normed vectors maximizing the sum of the:
squared correlation coefficients with quantitative variables
squared multiple correlation coefficients with polynoms
correlation ratios with factors.

References

Hill, M. O., and A. J. E. Smith. 1976. Principal component analysis of taxonomic data with multi-state discrete characters. Taxon, 25, 249-255.

De Leeuw, J., J. van Rijckevorsel, and . 1980. HOMALS and PRINCALS - Some generalizations of principal components analysis. Pages 231-242 in E. Diday and Coll., editors. Data Analysis and Informatics II. Elsevier Science Publisher, North Holland, Amsterdam.

Kiers, H. A. L. 1994. Simple structure in component analysis techniques for mixtures of qualitative ans quantitative variables. Psychometrika, 56, 197-212.

Examples

Run this code
data(dunedata)
dd1 <- dudi.mix(dunedata$envir, scann = FALSE)
if(adegraphicsLoaded()) {
  g1 <- scatter(dd1, row.plab.cex = 1, col.plab.cex = 1.5)
} else {
  scatter(dd1, clab.r = 1, clab.c = 1.5)
}

dd2 <- dudi.mix(dunedata$envir, scann = FALSE, add.square = TRUE)
if(adegraphicsLoaded()) {
  g2 <- scatter(dd2, row.plab.cex = 1, col.plab.cex = 1.5)
} else {
  scatter(dd2, clab.r = 1, clab.c = 1.5)
}  

Run the code above in your browser using DataLab