I was wondering if anybody could suggest an appropriate approach for the following...

I have one independent variable, X, which takes the values 0, 12.5, 25. I have two dependent variables, 1 normal and 1 binary. The mean of the normal variable depends on a function of a value of X, and the parameter "p" in the Bernoulli variable depends on a function of a value of X.

I want to generate data for the normal variable (by specifying a different mean and s.d for each X) and the binary variable (by specifying a different p for each X), and also have the ability to specify the correlation between them.

I have done this already for the normal and binary variable separately, assuming independence....see below....

I generated 1000 data points for each of the 2 dependent variables for each value of X such that I have

1000 data points from N(0.01,1)

1000 data points from Bernouilli(1,0.01)

1000 data points from N(0.201,1)

1000 data points from Bernouilli(1,0.201)

1000 data points from N(0.401,1)

1000 data points from Bernouilli(1,0.401)

I then collated the data together so effectively I have a table of data constructed of 2 columns where column 1 is the normal data and column 2 is the binary data.

But, what I really want to do is generate data as above, but assume that there may be a dependence between the normal and binary variables , that is, have the ability to specify the correlation between Column 1 and Column 2 and simulate data based on this, as well as the means and “p” parameters I have specified above.

Thanks for any replies.

Barry