Computes the RV coefficient between two groups of numerical variables.

rvcoef(Xa, Xb, row.w = NULL)

Arguments

Xa

data frame with the first group of numerical variables

Xb

data frame with the second group of numerical variables

row.w

numeric vector of row weights. If NULL (default), a vector of 1 for uniform row weights is used.

Details

Xa and Xb should have the same number of rows.

Value

numerical value : the RV coefficient

References

Escouffier, Y. (1973) Le traitement des variables vectorielles. Biometrics 29 751–760.

Author

Nicolas Robette

See also

Examples

# RV coefficient between decathlon results by sport
# and Rank and Points
library(FactoMineR)
data(decathlon)
Xa <- decathlon[,1:10]
Xb <- decathlon[,11:12]
str(Xa)
#> 'data.frame':	41 obs. of  10 variables:
#>  $ 100m       : num  11 10.8 11 11 11.3 ...
#>  $ Long.jump  : num  7.58 7.4 7.3 7.23 7.09 7.6 7.3 7.31 6.81 7.56 ...
#>  $ Shot.put   : num  14.8 14.3 14.8 14.2 15.2 ...
#>  $ High.jump  : num  2.07 1.86 2.04 1.92 2.1 1.98 2.01 2.13 1.95 1.86 ...
#>  $ 400m       : num  49.8 49.4 48.4 48.9 50.4 ...
#>  $ 110m.hurdle: num  14.7 14.1 14.1 15 15.3 ...
#>  $ Discus     : num  43.8 50.7 49 40.9 46.3 ...
#>  $ Pole.vault : num  5.02 4.92 4.92 5.32 4.72 4.92 4.42 4.42 4.92 4.82 ...
#>  $ Javeline   : num  63.2 60.1 50.3 62.8 63.4 ...
#>  $ 1500m      : num  292 302 300 280 276 ...
str(Xb)
#> 'data.frame':	41 obs. of  2 variables:
#>  $ Rank  : int  1 2 3 4 5 6 7 8 9 10 ...
#>  $ Points: int  8217 8122 8099 8067 8036 8030 8004 7995 7802 7733 ...
rvcoef(Xa, Xb)
#> [1] 0.09265003