create_cor_matrix: Create Custom Correlation Matrix

Description Usage Arguments Details Value Examples

View source: R/generatingData.R

Description

Creates a correlation matrix with a specified number of features with strong, medium, and weak correlations. Background correlation can be set by user with background= ; if no specifications given an identity matrix is returned.

Usage

1
2
create_cor_matrix(d, strong = 0, med = 0, weak = 0, none = 0,
  background = 0)

Arguments

d

A number. The dimensions of the matrix.

strong

Number of strong correlations in the matrix. Default: 0

med

Number of moderate correlations in the matrix. Default: 0

weak

Number of weak correlations in the matrix. Default: 0

none

Number of uncorrelated features. Default: 0

background

Background correlation amongst all features. Default: 0

Details

Correlation matrix is built from upper left corner starting with the first correlation strength specified and working iteratively through correlation strength specifications along the diagonal.

Value

A matrix with the specified correlation structure.

Examples

1
2
3
create_cor_matrix(5)
create_cor_matrix(10, strong=3, weak=5)
create_core_matrix(20, strong=5, med=7, weak=5, background=0.1)

emartchenko/mvsimstudy documentation built on April 20, 2018, 2:38 a.m.