[R] Generating a binomial random variable correlated with a

(Ted Harding) Ted.Harding at nessie.mcc.ac.uk
Sat Apr 16 09:21:42 CEST 2005


On 15-Apr-05 Ashraf Chaudhary wrote:
> 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

Hello Ashraf,

I do not know what you mean by "a binomial random variable linearly
correlated with a normal random variable." You can certainly (and
indeed your dichotomy method is one way) generate a binomial and
a normal which are correlated. But apparently this gives a result
which is "not the same as specified": however, I cannot see in
your description a specification which would violated by the result
of doing so.

You cannot expect a binomial variable to be such that, for instance,
its expectation conditional on the value of a normal variable would
be a linear function of the normal variable, since this would
allow a situation where the expectation was greater than 1 or less
than 0. But I wonder what else you could possibly mean by "linearly
correlated".

Please therefore be more explicit about the specification of your
problem!

Trying to help,
Ted.


--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk>
Fax-to-email: +44 (0)870 094 0861
Date: 16-Apr-05                                       Time: 08:21:42
------------------------------ XFMail ------------------------------




More information about the R-help mailing list