BookmarkSubscribeRSS Feed
tammy
Calcite | Level 5
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?
1 REPLY 1
lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12
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.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1528 views
  • 0 likes
  • 2 in conversation