corDensity | R Documentation |
Generate the marginal density of a correlation from a uniformly sampled R matrix.
corDensity(NVar)
NVar |
(integer) The order of the correlation matrix. |
corDensity
returns the following objects:
r (numeric) A sequence of numbers from -1, to 1 in .001 increments.
rDensity (numeric) The density of r
.
Niels G. Waller
Hürlimann, W. (2012). Positive semi-definite correlation matrices: Recursive algorithmic generation and volume measure. Pure Mathematical Science, 1(3), 137–149.
Joe, H. (2006). Generating random correlation matrices based on partial correlations. Journal of Multivariate Analysis, 97(10), 2177–2189.
out <- corDensity(NVar = 5)
plot(out$r, out$rDensity,
typ = "l",
xlab = "r",
ylab = "Density of r",
main = "")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.