Description Usage Arguments Value Note Author(s) Examples
Function that generates a correlation matrix of a predefined type and size
given appropriate correlation parameter(s), rho
.
1 | genCorMat(corstr = "independence", rho, maxClusterSize = 0)
|
corstr |
Structure of correlaiton matrix to be generated; 'independence', 'exchangeable', 'ar1', and 'unstructured' currently implemented. |
rho |
Correlation parameter; assumed to be of length 1 or
|
maxClusterSize |
size of the correlation matrix being generated. |
A correlation matrix of form matching corstr and of size maxClusterSize.
Mostly intended for internal use, but could be useful to user. Therefore, the function is exported.
Gregory Vaughan
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Generates Correlation Matricies easily
## When corstr = "independence", the value of rho
## is irrelevant
mat1 <- genCorMat(corstr = "independence", rho = .1, maxClusterSize = 3)
## Exchangeable
mat2 <- genCorMat(corstr = "exchangeable", rho = .3, maxClusterSize = 2)
## AR-1
mat3 <- genCorMat(corstr = "ar1", rho = .4, maxClusterSize = 4)
## unstructured
mat3 <- genCorMat(corstr = "unstructured",
rho = c(.3,.2,.1),
maxClusterSize = 3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.