generate_correlated_matrix {abnormality} | R Documentation |
Generate a matrix of correlated variables
Description
Generate a matrix of correlated variables
Usage
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
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)
[Package abnormality version 0.1.0 Index]