Re: cos2 dans statis

From: Pierre BADY (pierre.bady@univ-lyon1.fr)
Date: Wed Apr 21 2004 - 12:49:17 MEST


bonjour,

Oui et pas tout à fait. Il s'agit des valeurs des cosinus carrés entre les
k opérateurs et l'opérateur compromis reconstitué par les axes conservés
(donc sur la base des C.li).

####
statis <- function (X, scannf = TRUE, nf = 3, tol = 1e-07)
{
...
# C.li => compromis
# lwsqrt => racine du poids des lignes
w <- as.matrix(statis$C.li ) * lwsqrt

# matrix covariance/variance entre les individus du compromis => matrice
[nlig x nlig ]
# reconstruction du compromis
w <- w %*% t(w)

# normalisation => matrice [nlig x nlig]
w <- w/sqrt(sum(w * w))

# w vector [(nlig *nlig ) x 1]
w <- as.vector(unlist(w))

# sep matrix [(nlig*nlig) x ntab] contenant les opérateurs (en colonnes)
# calcul des produits scalaires entre les k opérateurs (déjà normalisés)
# et l’opérateur compromis (normalisés)
sep <- sep * unlist(w)
w <- apply(sep, 2, sum)

statis$cos2 <- w
....
}

#####
exemple:

         data(jv73)
         kta1 <- ktab.within(within.pca(jv73$morpho, jv73$fac.riv, scann =
FALSE))
         statis1 <- statis(kta1, scann = FALSE)
         statis1$cos2

cordialement

P.BADY

At 10:03 21/04/2004 +0200, Charline Laurent wrote:
>Bonjour,
>
>La fonction STATIS d'ADE4 sous R crée un certain nombre de valeurs,
>listées ci-dessous :
>
> 'statis' returns a list of class 'statis' containing :
>
> $RV: a matrix with the all RV coefficients
>
> RV.eig: a numeric vector with all the eigenvalues
>
> RV.coo: a data frame with the array scores
>
>tab.names: a vector of characters with the names of the arrays
>
>$RV.tabw: a numeric vector with the array weigths
>
> nf: an integer indicating the number of kept axes
>
> rank: an integer indicating the rank of the studied matrix
>
> C.li: a data frame with the row coordinates
>
> C.Co: a data frame with the column coordinates
>
> T4: a data frame with the principal vectors (for each table)
>
> TL: a data frame with the factors (not used)
>
> TC: a data frame with the factors for Co
>
> T4: a data frame with the factors for T4
>
> J'aimerais récupérer les cosinus-carré entre chaque tableau
> (opérateur k) et le compromis, permettant d'évaluer la qualité de
> l'expression par un tableau donné de la structure du compromis. Cette
> information numérique n'étant pas donnée par R, je me suis penchée sur
> le programme de la fonction STATIS :
>
> > statis
>function (X, scannf = TRUE, nf = 3, tol = 1e-07)
>{
>......
>statis$cos2 <- w
>.....
>}
>
>et vers la fin du programme, la fonction crée un objet "statis$cos2"...
>qui n' apparait pas dans les sorties.
>
>J'aimerais savoir si ces valeurs correspondent effectivement aux
>cosinus-carrés entre les tableaux et le compromis...
>
>Merci
>Charline Laurent
>

Pierre BADY
Université Claude Bernard Lyon 1
UMR CNRS 5023, LEHF
bat Alphonse Forel
43 boulevard du 11 novembre 1918
F-69622 VILLEURBANNE CEDEX
FRANCE
TEL : +33 (0)4 72 44 62 34
FAX : +33 (0)4 72 43 28 92
MEL : pierre.bady@univ-lyon1.fr
http://limnologie.univ-lyon1.fr
http://badgloup.ifrance.com



This archive was generated by hypermail 2b30 : Tue Sep 07 2004 - 13:30:56 MEST