Description Usage Arguments Value Author(s) References Examples
Generate a random correlation matrix based on random partial correlations.
1 | rcorrmatrix(d, alphad = 1)
|
d |
Dimension of the matrix. |
alphad |
α parameter for partial of 1,d given 2,…,d-1, for
generating random correlation matrix based on the method proposed by Joe (2006),
where d is the dimension of the correlation matrix.
The default value |
A correlation matrix.
Weiliang Qiu weiliang.qiu@gmail.com
Harry Joe harry@stat.ubc.ca
Joe, H. (2006) Generating Random Correlation Matrices Based on Partial Correlations. Journal of Multivariate Analysis, 97, 2177–2189.
1 2 3 | rcorrmatrix(3)
rcorrmatrix(5)
rcorrmatrix(5, alphad = 2.5)
|
Loading required package: MASS
[,1] [,2] [,3]
[1,] 1.0000000 0.5711815 -0.3692510
[2,] 0.5711815 1.0000000 -0.7002529
[3,] -0.3692510 -0.7002529 1.0000000
[,1] [,2] [,3] [,4] [,5]
[1,] 1.0000000 -0.5928222 0.523480744 -0.183527159 0.6645571
[2,] -0.5928222 1.0000000 0.108855102 0.608353481 -0.4118965
[3,] 0.5234807 0.1088551 1.000000000 -0.005384531 -0.1576855
[4,] -0.1835272 0.6083535 -0.005384531 1.000000000 0.2162224
[5,] 0.6645571 -0.4118965 -0.157685548 0.216222365 1.0000000
[,1] [,2] [,3] [,4] [,5]
[1,] 1.0000000 -0.30620906 -0.17443481 -0.25114364 0.5736854
[2,] -0.3062091 1.00000000 0.01607454 0.02311423 0.2588852
[3,] -0.1744348 0.01607454 1.00000000 -0.33697323 -0.2623731
[4,] -0.2511436 0.02311423 -0.33697323 1.00000000 0.2001922
[5,] 0.5736854 0.25888520 -0.26237309 0.20019218 1.0000000
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.