cancor package:stats R Documentation _C_a_n_o_n_i_c_a_l _C_o_r_r_e_l_a_t_i_o_n_s _D_e_s_c_r_i_p_t_i_o_n: Compute the canonical correlations between two data matrices. _U_s_a_g_e: cancor(x, y, xcenter = TRUE, ycenter = TRUE) _A_r_g_u_m_e_n_t_s: x: numeric matrix (n * p1), containing the x coordinates. y: numeric matrix (n * p2), containing the y coordinates. xcenter: logical or numeric vector of length p1, describing any centering to be done on the x values before the analysis. If 'TRUE' (default), subtract the column means. If 'FALSE', do not adjust the columns. Otherwise, a vector of values to be subtracted from the columns. ycenter: analogous to 'xcenter', but for the y values. _D_e_t_a_i_l_s: The canonical correlation analysis seeks linear combinations of the 'y' variables which are well explained by linear combinations of the 'x' variables. The relationship is symmetric as 'well explained' is measured by correlations. _V_a_l_u_e: A list containing the following components: cor: correlations. xcoef: estimated coefficients for the 'x' variables. ycoef: estimated coefficients for the 'y' variables. xcenter: the values used to adjust the 'x' variables. ycenter: the values used to adjust the 'x' variables. _R_e_f_e_r_e_n_c_e_s: Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) _The New S Language_. Wadsworth & Brooks/Cole. Hotelling H. (1936). Relations between two sets of variables. _Biometrika_, *28*, 321-327. Seber, G. A. F. (1984). _Multivariate Observations_. New York: Wiley, p. 506f. _S_e_e _A_l_s_o: 'qr', 'svd'. _E_x_a_m_p_l_e_s: pop <- LifeCycleSavings[, 2:3] oec <- LifeCycleSavings[, -(2:3)] cancor(pop, oec) x <- matrix(rnorm(150), 50, 3) y <- matrix(rnorm(250), 50, 5) (cxy <- cancor(x, y)) all(abs(cor(x %*% cxy$xcoef, y %*% cxy$ycoef)[,1:3] - diag(cxy $ cor)) < 1e-15) all(abs(cor(x %*% cxy$xcoef) - diag(3)) < 1e-15) all(abs(cor(y %*% cxy$ycoef) - diag(5)) < 1e-15)