Programming the statistical procedures from SAS

how to generate 3 independent variables that correlate

Reply
N/A
Posts: 1

how to generate 3 independent variables that correlate

how do i create a simulation with n observations where the variables such as income, age, gender, etc have a specific r or correlation such as .5?
Valued Guide
Valued Guide
Posts: 684

Re: how to generate 3 independent variables that correlate

I think the title of your request is misleading since you don't seem to want independent variables generated. It is easy to use PROC IML to generate correlated normal variables. Google searches will show lots of examples. There is a whole chapter in the IML documentation on simulating values of different distributions. If you want to avoid IML, the new procedure SIMNORMAL should work fine. You can either input a covariance matrix directly, or take one from a PROC CORR run, and then generate as many values as you want. I have not used SIMNORMAL yet.
Ask a Question
Discussion stats
  • 1 reply
  • 92 views
  • 0 likes
  • 2 in conversation