Looking for help with the following problem.

 

Given a sample of zeros and ones, for example:

 

> VECTOR1<-rep(c(1,0),c(15,10))

> VECTOR1

 [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0

 

How would I create a new sample (VECTOR2) also containing zeros and
ones, in which the phi-coefficient between the two sample vectors was
drawn from a population with a known phi-coefficient value?

 

Basically, I have a vector of zeros and ones and want to simulate
another vector such that the two vectors have a known phi-coefficient.

 

I know there are ways to do this with normally distributed numbers (for
example the mvrnorm function in MASS), but am stumped when dealing with
dichotomous variables.

 

Appreciate any thoughts.

 

Paul

 


	[[alternative HTML version deleted]]


