acor {nscancor} | R Documentation |
Additional Explained Correlation
Description
acor
computes the additional standard correlation explained by each
canonical variable, taking into account the possible non-conjugacy of the
canonical vectors. The result of the analysis is returned as a list of class
nscancor
.
Usage
acor(
x,
xcoef,
y,
ycoef,
xcenter = TRUE,
ycenter = TRUE,
xscale = FALSE,
yscale = FALSE
)
Arguments
x |
a numeric matrix which provides the data from the first domain |
xcoef |
a numeric data matrix with the canonical vectors related to
|
y |
a numeric matrix which provides the data from the second domain |
ycoef |
a numeric data matrix with the canonical vectors related to
|
xcenter |
a logical value indicating whether the empirical mean of (each
column of) |
ycenter |
analogous to |
xscale |
a logical value indicating whether the columns of |
yscale |
analogous to |
Details
The additional correlation is measured after projecting the corresponding canonical vectors to the ortho-complement space spanned by the previous canonical variables. This procedure ensures that the correlation explained by non-conjugate canonical vectors is not counted multiple times. See Mackey (2009) for a presentation of generalized deflation in the context of principal component analysis (PCA), which was adapted here to CCA.
acor
is also useful to build a partial CCA model, to be completed with
additional canonical variables computed using nscancor
.
Value
A list of class nscancor
containing the
following elements:
cor |
the additional correlation explained by each pair of canonical variables |
xcoef |
copied from the input arguments |
ycoef , ycenter , yscale |
copied from the input arguments |
xp |
the deflated data matrix corresponding to |
yp |
analogous to |
References
Mackey, L. (2009) Deflation Methods for Sparse PCA. In Advances in Neural Information Processing Systems (pp. 1017–1024).
Examples
data(nutrimouse, package = "CCA")
x <- nutrimouse$gene[ , 1:5]
y <- nutrimouse$lipid
cc <- cancor(x, y)
# Re-compute explained correlation
ac <- acor(x, cc$xcoef, y, cc$ycoef)
# Results should agree
print(cc$cor)
print(ac$cor)