Hi. I am trying to generate a correlated binary data set. I've tried to use mvtBinaryEP, binarySimCLF, and bindata packages but none of them works in R version 2.15.1. Do you know any package to generate correlated binary covariates and work in R version 2.15.1, or how to generate it? Thanks, [[alternative HTML version deleted]]
A simple approach is to generate correlated normal data (mvrnorm function in MASS package is one way), then use a cut-off to convert them to binary. On Wed, Jul 4, 2012 at 12:25 PM, Soyeon Kim <yunni0731 at gmail.com> wrote:> Hi. > I am trying to generate a correlated binary data set. > I've tried to use mvtBinaryEP, binarySimCLF, and bindata packages but none > of them works in R version 2.15.1. > Do you know any package to generate correlated binary covariates and work > in R version 2.15.1, or how to generate it? > > Thanks, > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Gregory (Greg) L. Snow Ph.D. 538280 at gmail.com
On 2012-07-04 11:25, Soyeon Kim wrote:> Hi. > I am trying to generate a correlated binary data set. > I've tried to use mvtBinaryEP, binarySimCLF, and bindata packages but none > of them works in R version 2.15.1.[...] You'll have to be more forthcoming about what you mean by "works". What error is produced? I just tried the examples in mvtBinaryEP and in bindata and both work just fine for me. Perhaps you don't have the mvtnorm package installed? > sessionInfo() R version 2.15.1 Patched (2012-06-27 r59661) Platform: x86_64-pc-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=English_Canada.1252 LC_CTYPE=English_Canada.1252 [3] LC_MONETARY=English_Canada.1252 LC_NUMERIC=C [5] LC_TIME=English_Canada.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] bindata_0.9-18 e1071_1.6 class_7.3-4 mvtBinaryEP_1.0.1 [5] mvtnorm_0.9-9992 loaded via a namespace (and not attached): [1] tools_2.15.1 Peter Ehlers