rcorr: Generate a random correlation matrix

Description Usage Arguments Value Examples

View source: R/simfunc.R

Description

Generates a random draw from a Wishart distribution with a specified degrees of freedom (nu) and then standarizes it to obtain a correlation matrix. The degrees of freedom must be equal to or greater than the number of variables. Larger degrees of freedom shrink the correlations towards the diagonal. When nu = p the correlations are entirely random.

Usage

1
rcorr(p, nu = 1)

Arguments

p

number of variables

nu

the degrees of freedom of the wishart distribution

Value

a matrix

Examples

1
rcorr(10, 15)

abnormally-distributed/cvreg documentation built on May 3, 2020, 3:45 p.m.