EVOLUTION-MANAGER
Edit File: cancor.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Canonical Correlations</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for cancor {stats}"><tr><td>cancor {stats}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Canonical Correlations</h2> <h3>Description</h3> <p>Compute the canonical correlations between two data matrices. </p> <h3>Usage</h3> <pre> cancor(x, y, xcenter = TRUE, ycenter = TRUE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>numeric matrix (<i>n * p1</i>), containing the x coordinates.</p> </td></tr> <tr valign="top"><td><code>y</code></td> <td> <p>numeric matrix (<i>n * p2</i>), containing the y coordinates.</p> </td></tr> <tr valign="top"><td><code>xcenter</code></td> <td> <p>logical or numeric vector of length <i>p1</i>, describing any centering to be done on the x values before the analysis. If <code>TRUE</code> (default), subtract the column means. If <code>FALSE</code>, do not adjust the columns. Otherwise, a vector of values to be subtracted from the columns.</p> </td></tr> <tr valign="top"><td><code>ycenter</code></td> <td> <p>analogous to <code>xcenter</code>, but for the y values.</p> </td></tr> </table> <h3>Details</h3> <p>The canonical correlation analysis seeks linear combinations of the <code>y</code> variables which are well explained by linear combinations of the <code>x</code> variables. The relationship is symmetric as ‘well explained’ is measured by correlations. </p> <h3>Value</h3> <p>A list containing the following components: </p> <table summary="R valueblock"> <tr valign="top"><td><code>cor</code></td> <td> <p>correlations.</p> </td></tr> <tr valign="top"><td><code>xcoef</code></td> <td> <p>estimated coefficients for the <code>x</code> variables.</p> </td></tr> <tr valign="top"><td><code>ycoef</code></td> <td> <p>estimated coefficients for the <code>y</code> variables.</p> </td></tr> <tr valign="top"><td><code>xcenter</code></td> <td> <p>the values used to adjust the <code>x</code> variables.</p> </td></tr> <tr valign="top"><td><code>ycenter</code></td> <td> <p>the values used to adjust the <code>x</code> variables.</p> </td></tr> </table> <h3>References</h3> <p>Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988). <em>The New S Language</em>. Wadsworth & Brooks/Cole. </p> <p>Hotelling H. (1936). Relations between two sets of variables. <em>Biometrika</em>, <b>28</b>, 321–327. doi: <a href="https://doi.org/10.1093/biomet/28.3-4.321">10.1093/biomet/28.3-4.321</a>. </p> <p>Seber, G. A. F. (1984). <em>Multivariate Observations</em>. New York: Wiley. Page 506f. </p> <h3>See Also</h3> <p><code><a href="../../base/html/qr.html">qr</a></code>, <code><a href="../../base/html/svd.html">svd</a></code>. </p> <h3>Examples</h3> <pre>## signs of results are random 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) </pre> <hr /><div style="text-align: center;">[Package <em>stats</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>