Re: correlated binary data and overall probability

1 message Options
Embed this post
Permalink
Thevini & Christian Lerch

Re: correlated binary data and overall probability

Reply Threaded More More options
Print post
Permalink
To answer my own question:
The package mvtBinaryEP was helpful!

Christian Lerch schrieb:

> Dear All,
>
> I try to simulate correlated binary data for a clinical research project.
> Unfortunately, I do not come to grips with bindata().
>
> Consider
> corr<-data.frame(ID=as.factor(rep(c(1:10), each=5)),
>         task=as.factor(rep(c(1:5),10)))
>
> [this format might be more appropriate:]
> corr2<-data.frame(ID=as.factor(rep(c(1:10),5)),
>         tablet=as.factor(rep(c(1:5),each=10)))
>
> Now, I want to add one column 'outcome' for the binary response:
> * within each 'task', the probabilty of success (1) is fixed, (say
> rbinom(x,1,0.7))
> * within each 'ID', the outcomes are correlated (say 0.8)
>
> How can I generate this column 'outcome' with the given proporties?
>
> Many thanks for hints or even code!
>
> Regards,
> Christian

______________________________________________
[hidden email] 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.