Hello,
Could anyone explain me how to generate two bivariates and correlated normal distributions with 5000 sample size?
Can you say more? The title of your post says "univariate and correlated," but your message says "two bivariates," so I am confused. Are you trying to generate X from a multivariate normal and then generate a binary response based on the X variables? Such as simulated data from a logistic model?
You can use the RANDNORMAL function to generate correlated normal data. For example:
proc iml;
call randseed(1);
N = 5000; /* sample size */
Mean = {1 2}; /* mean of population */
Cov = {2.4 3, 3 8.1};/* covariance of population */
x = RandNormal( N, Mean, Cov );
Can you say more? The title of your post says "univariate and correlated," but your message says "two bivariates," so I am confused. Are you trying to generate X from a multivariate normal and then generate a binary response based on the X variables? Such as simulated data from a logistic model?
You can use the RANDNORMAL function to generate correlated normal data. For example:
proc iml;
call randseed(1);
N = 5000; /* sample size */
Mean = {1 2}; /* mean of population */
Cov = {2.4 3, 3 8.1};/* covariance of population */
x = RandNormal( N, Mean, Cov );
I am sorry, but I do not understand. The RMSE of WHAT goes down? As you know, you can generate binary variables as 0/1 or as 1/0. What do you observe if you let p --> 1-p? In your program, that would correspond to
z[i,j] = (p<=u);
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.
Find more tutorials on the SAS Users YouTube channel.