turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-11-2014 09:34 PM

Hello,

Could anyone explain me how to generate two bivariates and correlated normal distributions with 5000 sample size?

Accepted Solutions

Solution

05-12-2014
09:04 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to gocersah

05-12-2014 09:04 AM

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 );

All Replies

Solution

05-12-2014
09:04 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to gocersah

05-12-2014 09:04 AM

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 );

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Rick_SAS

05-13-2014 01:37 PM

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);