mymean: vector of length 4, giving the mean of each variable.
mysigma: variance-covariance matrix of multivariate normal distribution from which x1-x4 are to be drawn.
residsd: residual standard deviation.
x2binary: if TRUE, x2 is converted to a binary factor variable (1, 2) with probability equal to the logistic of the underlying normally distributed variable.
Returns
Data frame with 5 columns:
y: continuous, generated by y = x1 + x2 + x3 + normal error if x2 is continuous, or y = x1 + x2 + x3 - 1 + normal error if x2 is a factor with values 1 or 2
x1: continuous
x2: continuous or binary (factor) with value 1 or 2