View source: R/simulate_data_baseline.R
covariance_matrix | R Documentation |
Create Covariance Matrix
covariance_matrix(diag, upper_tri)
diag |
Diagonal entries of the covariance matrix |
upper_tri |
Upper triangle entries of the matrix, specified column wise. |
A symmetric matrix with diag
values on the main diagonal and
upper_tri
values in the lower and upper triangles.
m1 <- covariance_matrix(c(1, 1, 1, 1), c(.8, .3, .8, 0, 0, 0))
m1
mvtnorm::rmvnorm(5, mean = c(0, 0, 0, 0), sigma = m1)
# No correlation
covariance_matrix(c(1, 2, 3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.