CSgenerate | R Documentation |
Generate a compound symmetric correlation matrix
CSgenerate(n, rho)
n |
number of dimensions |
rho |
off-diagonal element - a correlation between -1 and 1. Will warn if less than 0. |
returns an n \times n
matrix with 1 on the diagonal and
rho
on the off-diagonal.
# generates a covariance matrix with 1 on the main diagonal
# and 0.5 on the off-diagonal elements.
CSgenerate(3, .5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.