supcol {ade4}R Documentation

Projections of Supplementary Columns

Description

performs projections of supplementary columns.

Usage

supcol(x, ...)
## Default S3 method:
supcol(x, Xsup, ...) 
## S3 method for class 'coa':
supcol(x, Xsup, ...) 

Arguments

x an object used to select a method
Xsup an array with the supplementary columns (Xsup and x$tab have the same row number)
... further arguments passed to or from other methods

Details

If supcol.default is used, the column vectors of Xsup are projected without prior modification onto the principal components of dudi with the scalar product associated to the row weightings of dudi.

Value

A list of two components:
tabsup data frame containing the array with the supplementary columns transformed or not
cosup data frame containing the coordinates of the supplementary projections

Author(s)

Daniel Chessel
Anne B Dufour dufour@biomserv.univ-lyon1.fr

Examples

data(rpjdl)
rpjdl.coa <- dudi.coa(rpjdl$fau, scan = FALSE, nf = 4)
rpjdl.coa$co[1:3,]
supcol (rpjdl.coa,rpjdl$fau[,1:3])$cosup # the same

data(doubs)
dudi1 <- dudi.pca(doubs$poi, scal = FALSE, scan = FALSE)
s.arrow(dudi1$co)
s.arrow(supcol.default(dudi1,data.frame(scalewt(doubs$mil)))$cosup,
    add.p = TRUE, clab = 2)
symbols(0, 0, circles = 1, inches = FALSE, add = TRUE)

Worked out examples


> library(ade4)
> ### Name: supcol
> ### Title: Projections of Supplementary Columns
> ### Aliases: supcol supcol.coa supcol.default
> ### Keywords: multivariate
> 
> ### ** Examples
> 
> data(rpjdl)
> rpjdl.coa <- dudi.coa(rpjdl$fau, scan = FALSE, nf = 4)
> rpjdl.coa$co[1:3,]
        Comp1      Comp2      Comp3     Comp4
AR  1.3906689 -0.4366455 -0.0899963 0.4036248
CP -0.8298783 -0.2134175 -0.9950055 0.8763367
ST -0.6045373  0.1035953 -0.6820577 0.4254950
> supcol (rpjdl.coa,rpjdl$fau[,1:3])$cosup # the same
        Comp1      Comp2      Comp3     Comp4
AR  1.3906689 -0.4366455 -0.0899963 0.4036248
CP -0.8298783 -0.2134175 -0.9950055 0.8763367
ST -0.6045373  0.1035953 -0.6820577 0.4254950
> 
> data(doubs)
> dudi1 <- dudi.pca(doubs$poi, scal = FALSE, scan = FALSE)
> s.arrow(dudi1$co)
> s.arrow(supcol.default(dudi1,data.frame(scalewt(doubs$mil)))$cosup,
+     add.p = TRUE, clab = 2)
> symbols(0, 0, circles = 1, inches = FALSE, add = TRUE)
> 
> 
> 
> 

[Package ade4 Index]