Results 1 to 3 of 3

Thread: Correlated Dataset Generator In Excel

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2022

    Correlated Dataset Generator In Excel

    I have developed a macro-enabled Excel program that creates datasets of variables with user-specified correlations. The program accommodates normal random variates, scale variables with specified mean, standard deviation, etc. and/or binomial variables. It is freely available; please share it with others.

    Copy & paste into browser:

  2. #2
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Near Nashville TN

    Re: Correlated Dataset Generator

    Ahhh, I did this years ago. Changing the mean and/or standard deviation doesn't change the correlation, and it's easy to do, as different means and/or SDs are just linear transformations.

    Creating a specific correlation is a bit tricky though. As said, it's been years ago but, if I remember correctly, I just did it by creating a perfect correlation and then swapping random pairs in one of the columns until I got the correlation I wanted (within an epsilon tolerance).

    Now, a trickier problem is creating specific bi-variate correlations among three or more columns.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  3. #3
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002

    Re: Correlated Dataset Generator In Excel

    Since it isn't a question, it belongs in either Utilities or the CodeBank. I opted for Utilities because the source isn't included, but a link to a spreadsheet is.
    My usual boring signature: Nothing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width