Learn R Programming

SimComp (version 3.3)

rcm: Random Correlation Matrices

Description

Correlation matrices with random off-diagonal elements.

Usage

rcm(nrow = NULL, ncol = NULL)

Arguments

nrow

the desired number of rows

ncol

the desired number of columns

Value

A symmetric correlation matrix with random elements.

Details

As a correlation matrix is symmetric, only one of nrow or ncol needs to be specified.

References

Holmes, R.B. (1991): On random correlation matrices. Siam Journal on Matrix Analysis and Applications 12, 239--272.

See Also

ermvnorm

Examples

Run this code
# NOT RUN {
# Example 1:
# A correlation matrix representing three randomly correlated endpoints.

set.seed(1234)
rcm(nrow=3)

# Example 2:
# A correlation matrix representing five randomly correlated endpoints.

set.seed(5678)
rcm(ncol=5)
# }

Run the code above in your browser using DataLab