cmat.star.BinOrdNN: Computes the intermediate correlation matrix

Description Usage Arguments Value See Also Examples

View source: R/cmat.star.BinOrdNN.R

Description

The function computes the correlations of intermediate multivariate normal data prior to subsequent dichotomization (for binary variables), ordinalization (for ordinal variables), and transformation (for continuous variables)

Usage

1
cmat.star.BinOrdNN(plist, skew.vec, kurto.vec, no.bin, no.ord, no.NN, CorrMat)

Arguments

plist

A list of probability vectors corresponding to each binary/ordinal variable. The i-th element of plist is a vector of the cumulative probabilities defining the marginal distribution of the i-th component of the multivariate variables, which is binary/ordinal. If the i-th variable is binary, the i-th vector of plist will contain 1 probability value. If the i-th variable is ordinal with k categories (k > 2), the i-th vector of plist will contain (k-1) probability values. The k-th element is implicitly 1.

skew.vec

The skewness vector for continuous variables.

kurto.vec

The kurtosis vector for continuous variables.

no.bin

Number of binary variables.

no.ord

Number of ordinal variables.

no.NN

Number of continuous variables.

CorrMat

The target correlation matrix which must be positive definite and within the valid limits.

Value

An intermediate correlation of size (no.bin + no.ord + no.NN)*(no.bin + no.ord + no.NN)

See Also

validate.target.cormat.BinOrdNN, IntermediateNonNor, IntermediateONN

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run:
no.bin <- 1
no.ord <- 2
no.NN <- 4
q <- no.bin + no.ord + no.NN
set.seed(54321)

Sigma <- diag(q)
Sigma[lower.tri(Sigma)] <- runif((q*(q-1)/2),-0.4,0.4)
Sigma <- Sigma + t(Sigma)
diag(Sigma) <- 1

marginal <- list(0.3, cumsum(c(0.30, 0.40) ), cumsum(c(0.4, 0.2, 0.3) ) )
cmat.star <- cmat.star.BinOrdNN(plist=marginal, skew.vec=c(1,2,2,3), 
kurto.vec=c(2,7,25,25),no.bin=1, no.ord=2, no.NN=4, CorrMat=Sigma) 
## End(Not run)

BinOrdNonNor documentation built on March 22, 2021, 9:07 a.m.