Description Usage Arguments Value See Also Examples
View source: R/validation.corr.R
This function validates the specified correlation vector and/or matrix for appropriate dimension, symmetry, range, and positive definiteness. If both correlation matrix and correlation vector are supplied, it checks whether the matrix and vector are conformable.
1 | validation.corr(n.P, n.B, n.C, corr.vec = NULL, corr.mat = NULL)
|
n.P |
Number of Poisson variables. |
n.B |
Number of binary variables. |
n.C |
Number of continuous variables. |
corr.vec |
Vector of elements below the diagonal of correlation matrix ordered column-wise. |
corr.mat |
Specified correlation matrix. |
The function returns TRUE if no specification problem is encountered. Otherwise, it returns an error message.
correlation.limits
, correlation.bound.check
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | n.P<-1
n.B<-1
n.C<-1
corr.vec=c(0.2,0.1,0.5)
validation.corr(n.P,n.B,n.C,corr.vec,corr.mat=NULL)
n.P<-2
n.B<-2
n.C<-2
corr.mat=matrix(0.5,6,6)
diag(corr.mat)=1
validation.corr(n.P,n.B,n.C,corr.vec=NULL,corr.mat)
## Not run:
n.P<-2
n.B<-2
n.C<-1
corr.mat=matrix(0.5,6,6)
diag(corr.mat)=1
validation.corr(n.P,n.B,n.C,corr.vec=NULL,corr.mat)
n.P<-2
n.B<-2
n.C<-2
corr.mat=matrix(0.5,6,6)
corr.mat[1,2]=0.4
diag(corr.mat)=1
validation.corr(n.P,n.B,n.C,corr.vec=NULL,corr.mat)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.