Biserial.Corr.BN: Computes the biserial correlation matrix for binary and...

Description Usage Arguments Value References See Also Examples

View source: R/Biserial.Corr.BN.R

Description

This function computes the biserial correlation matrix for binary-continuous non-normal combinations as formulated in Demirtas et al. (2012).

Usage

1
Biserial.Corr.BN(n.BB, n.NN, prop.vec, corr.vec = NULL, corr.mat = NULL, coef.mat)

Arguments

n.BB

Number of binary variables.

n.NN

Number of continuous non-normal variables.

prop.vec

Probability vector for binary variables.

corr.vec

Vector of elements below the diagonal of correlation matrix ordered columnwise.

corr.mat

Specified correlation matrix.

coef.mat

Matrix of coefficients produced from fleishman.coef.

Value

A matrix of size n.BB*n.NN.

References

Demirtas, H., Hedeker, D., and Mermelstein, R.J. (2012). Simulation of massive public health data by power polynomials. Statistics in Medicine, 31(27), 3337-3346.

See Also

fleishman.coef, Tetra.Corr.BB, Int.Corr.NN, overall.corr.mat

Examples

 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
n.BB=2
n.NN=4
prop.vec=c(0.4,0.7)
corr.vec=NULL
corr.mat=matrix(c(1.0,-0.3,-0.3,-0.3,-0.3,-0.3,
-0.3,1.0,-0.3,-0.3,-0.3,-0.3,
-0.3,-0.3,1.0,0.4,0.5,0.6,
-0.3,-0.3,0.4,1.0,0.7,0.8,
-0.3,-0.3,0.5,0.7,1.0,0.9,
-0.3,-0.3,0.6,0.8,0.9,1.0),6,byrow=TRUE)

coef.mat=matrix(c(
 -0.31375,  0.00000,  0.10045, -0.10448,
  0.82632,  1.08574,  1.10502,  0.98085,
  0.31375,  0.00000, -0.10045,  0.10448,
  0.02271, -0.02945, -0.04001,  0.00272),4,byrow=TRUE)

bicor.mat=Biserial.Corr.BN(n.BB,n.NN,prop.vec,corr.vec=NULL,corr.mat,coef.mat)

n.BB=1
n.NN=1
prop.vec=0.6
corr.vec=NULL
corr.mat=matrix(c(1,-0.3,-0.3,1),2,2)
coef.mat=matrix(c(-0.31375,0.82632,0.31375,0.02271),4,1)
bicor.mat=Biserial.Corr.BN(n.BB,n.NN,prop.vec,corr.vec=NULL,corr.mat,coef.mat)

Example output

Loading required package: BB
Loading required package: corpcor
Loading required package: mvtnorm
Loading required package: Matrix

BinNonNor documentation built on March 22, 2021, 9:08 a.m.