[R] Generating a binomial random variable correlated with a normal random variable

Ashraf Chaudhary mchaudha at jhsph.edu
Fri Apr 15 22:39:05 CEST 2005


Hi,
I am posting this problem again (with some additional detail) as I am stuck
and could not get it resolved as yet. I tried to look up in alternative
sources but with no success. Here it is:

I need to generate a binomial (binary 0/1) random variable linearly
correlated with a normal random variable with a specified correlation. Off
course, the correlation coefficient would not be same at each run because of
randomness. 

If I generate two correlated normals with specified correlation and
dichotomize one, the correlation of a normal and the binomial random
variable would not be the same as specified.

I greatly appreciate your help.
Ashraf




More information about the R-help mailing list