cormat: Make a correlation matrix

Description Usage Arguments Value Examples

View source: R/cormat.R

Description

cormat makes a correlation matrix from a single number, vars\*vars matrix, vars\*vars vector, or a vars\*(vars-1)/2 vector.

Usage

1
cormat(cors = 0, vars = 3)

Arguments

cors

the correlations among the variables (can be a single number, vars\*vars matrix, vars\*vars vector, or a vars\*(vars-1)/2 vector)

vars

the number of variables in the matrix

Value

matrix

Examples

1
2
3
4
5
6
cormat(.5, 3)
cormat(c( 1, .2, .3, .4,
         .2,  1, .5, .6, 
         .3, .5,  1, .7,
         .4, .6, .7,  1), 4)
cormat(c(.2, .3, .4, .5, .6, .7), 4)

faux documentation built on Sept. 14, 2021, 1:08 a.m.