Description Usage Arguments Value See Also Examples
View source: R/IntermediateOO.R
This function computes the correlation of normal-normal pairs before ordinalizing both components.
1 | IntermediateOO(plist, OOCorrMat)
|
plist |
A list of probability vectors corresponding to each ordinal variable. The i-th element of |
OOCorrMat |
A matrix of pairwise target correlations between ordinal variables. It is a symmetric square matrix whose diagonal elements are 1. |
A pairwise correlation matrix of intermediate correlations for ordinal variables.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | no.ord=3
no.norm =4
n = 200
q=no.ord + no.norm
set.seed(12345)
Sigma = diag(q)
Sigma[lower.tri(Sigma)] = runif( (q*(q-1)/2),-0.4,0.4 )
Sigma = Sigma + t(Sigma)
diag(Sigma)=1
Sigma=as.matrix( nearPD(Sigma,corr = TRUE, keepDiag = TRUE)$mat )
marginal = list( 0.3, cumsum( c(0.30, 0.40) ), cumsum(c(0.4, 0.2, 0.3) ) )
OOCorrMat = Sigma[1:3, 1:3]
IntermediateOO(marginal, OOCorrMat)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.