draw.correlated.binary: Generation of Correlated Binary Data

Description Usage Arguments Value References See Also Examples

Description

This function implements pseudo-random number generation for a multivariate Bernoulli distribution (correlated binary data).

Usage

1
draw.correlated.binary(no.row,d,prop.vec,corr.mat)

Arguments

no.row

Number of rows to generate.

d

Number of variables to generate.

prop.vec

Vector of means.

corr.mat

Correlation matrix.

Value

A no.row \times d matrix of generated data.

References

Park, C. G., Park, T., & Shin D. W. (1996). A simple method for generating correlated binary variates. The American Statistician, 50(4), 306-310.

See Also

loc.min

Examples

1
2
3
4
5
6
cmat<-matrix(c(1,0.2,0.3,0.2,1,0.2,0.3,0.2,1), nrow=3, ncol=3)
propvec=c(0.3,0.5,0.7)

mydata=draw.correlated.binary(no.row=1e5,d=3,prop.vec=propvec,corr.mat=cmat)
apply(mydata,2,mean)-propvec
cor(mydata)-cmat

MultiRNG documentation built on March 6, 2021, 1:06 a.m.