Ashraf Chaudhary
2005-Apr-03 22:41 UTC
[R] Generating a binomial random variable correlated with a normal random variable
Hi All: I would like to generate a binomial random variable that correlates with a normal random variables with a specified correlation. Off course, the correlation coefficient would not be same at each run because of randomness. I greatly appreciate your input. Ashraf
(Ted Harding)
2005-Apr-04 08:03 UTC
[R] Generating a binomial random variable correlated with a
On 03-Apr-05 Ashraf Chaudhary wrote:> Hi All: > I would like to generate a binomial random variable that > correlates with a normal random variables with a specified > correlation. Off course, the correlation coefficient would > not be same at each run because of randomness. > I greatly appreciate your input. > AshrafIt's not at all clear what you mean by this. For example, are you seeking: A) X (continuous) and R (discrete, distributed on (0,n)) are such that the marginal distribution of X is normal, the marginal distribution of R is binomial, and the correlation coefficient between X and R is specified? B) Given X, R on (0,n) has a binomial distribution with probability parameter p which depends on X? C) For each of n values of X, R is binary (0,1) with P[R=1] depending on X, such that sum(R from 1 to n) has a binomial distribution, and the correlation between X and R is specified? And so on. Also, it is not obvious what interpretation to put on the correlation coefficient between a discrete variable and a continuous variable. How large is the "n" parameter in the binomial distribution intended to be? It would help if you described what you are really looking for in much more explicit detail! Bestg wishes, Ted. -------------------------------------------------------------------- E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk> Fax-to-email: +44 (0)870 094 0861 Date: 04-Apr-05 Time: 09:03:29 ------------------------------ XFMail ------------------------------
Dimitris Rizopoulos
2005-Apr-04 09:12 UTC
[R] Generating a binomial random variable correlated with a normalrandom variable
one idea is to consider that the underlying (for ease normally distributed) latent variables that produce the Bernoulli trials are correlated with your original normal random variable. I hope it helps. Best, Dimitris ---- Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/16/336899 Fax: +32/16/337015 Web: http://www.med.kuleuven.ac.be/biostat/ http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm ----- Original Message ----- From: "Ashraf Chaudhary" <mchaudha at jhsph.edu> To: <r-help at stat.math.ethz.ch> Sent: Monday, April 04, 2005 12:41 AM Subject: [R] Generating a binomial random variable correlated with a normalrandom variable> Hi All: > I would like to generate a binomial random variable that correlates > with a > normal random variables with a specified correlation. Off course, > the > correlation coefficient would not be same at each run because of > randomness. > I greatly appreciate your input. > Ashraf > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html >
Ashraf Chaudhary
2005-Apr-15 20:39 UTC
[R] Generating a binomial random variable correlated with a normal random variable
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
(Ted Harding)
2005-Apr-16 07:21 UTC
[R] Generating a binomial random variable correlated with a
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. > AshrafHello 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 ------------------------------