Task at hand: generate a simulated dataset containing both continuous and categorical variables, given a pre-defined correlation matrix.
The question: it is unclear how to generate both continuous and categorical variables at the same time, all correlated between each other. For example, let's say we need to have a dataset with five variables, three continuous variables, and two categorical variables. The first categorical could refer to three income categories (therefore being ordinal), and the second one could be gender (therefore being nominal). The three continuous variables could be, say, scores on three psychological tests. All of them should be correlated to a given degree.
It would be possible to create a dataset with five correlated continuous variables, and then bin two of those into categorical, hopefully retaining some degree of the original relationship. Yet I am not sure how to control the degree of correlation in this case. The data simulation would be in R. Any ideas?
EDIT 1: To be clear, when it concerns categorical data, by correlation I mean statistical association, however it is measured (I have no preference there). Not the Pearson correlation.