| GenMatrix | R Documentation |
A shortcut to generate correlation matrix. The generated matrix is the input of the GenData.
GenMatrix(p, rlist = list(), varnames = NULL)
p |
number of variables in the matrix |
rlist |
a list to add values to matrix. The vectors in the list contain three elements, with the first two being the position of names of variables, and the last one being the correlations between them. |
varnames |
variable names. If NULL, the varnames are defaulted as x1, ..., xp. |
Shuo Wang
m <- GenMatrix(3, rlist = list(c(1, 2, 0.5), c(1, 3, 0.3), c(2, 3, 0.7)))
m
m <- GenMatrix(3, rlist = list(c("x1", "x2", 0.5), c("x1", "x3", 0.3),
c("x2", "x3", 0.7)))
m
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.