generate_correlated_matrix: Generate a matrix of correlated variables

Description Usage Arguments Value Examples

View source: R/generate_simulated_data.R

Description

Generate a matrix of correlated variables

Usage

1
generate_correlated_matrix(n, p, corr, constant_cov_matrix = T, mean = 0)

Arguments

n

number of observations

p

number of features/variables

corr

the correlation coefficient (-1 < r < 1)

constant_cov_matrix

should the value of corr be constant in the covariance matrix, or should corr be the average value in the covariance matrix.

mean

the mean value of the generated variables.

Value

an n x p matrix

Examples

1
2
Subject <- generate_correlated_matrix(1, 100, corr = .75,constant_cov_matrix = TRUE)
Reference_Population <- generate_correlated_matrix(100, 100, corr = .75,constant_cov_matrix = TRUE)

abnormality documentation built on May 2, 2019, 8:54 a.m.