rcc(X, Y, ncomp = 2, lambda1 = 0, lambda2 = 0)
NA
s are allowed.NA
s are allowed.lambda1=lambda2=0
.rcc
returns a object of class "rcc"
, a list that
contains the following components:cancor
function performs the core of computations
but additional tools are required to deal with data sets highly
correlated (nearly collinear), data sets with more variables
than units by example.
The rcc
function, the regularized version of CCA,
is one way to deal with this problem by
including a regularization step in the computations of CCA.
Such a regularization in this context
was first proposed by Vinod (1976), then developped by Leurgans et al. (1993).
It consists in the regularization of the empirical covariances matrices of
$X$ and $Y$ by adding a multiple of the matrix identity, that is,
Cov$(X)+ \lambda_1 I$ and Cov$(Y)+ \lambda_2 I$.
When lambda1=0
and lambda2=0
, rcc
perform classic
CCA, if posible.
The estimation of the missing values can be performed
by the reconstitution of the data matrix using the nipals
function. Otherwise, missing
values are handled by casewise deletion in the rcc
function.summary
, estim.regul
,
plot.rcc
, plotIndiv
,
plotVar
, cim
## Classic CCA
data(linnerud)
X <- linnerud$exercise
Y <- linnerud$physiological
linn.res <- rcc(X, Y)
## Regularized CCA
data(nutrimouse)
X <- nutrimouse$lipid
Y <- nutrimouse$gene
nutri.res <- rcc(X, Y, ncomp = 3, lambda1 = 0.064, lambda2 = 0.008)
Run the code above in your browser using DataLab