Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Nick Cox <njcoxstata@gmail.com> |
To | "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |
Subject | Re: st: problems with corr2data command |
Date | Wed, 5 Feb 2014 11:34:06 +0000 |
This appeared in different form as http://stackoverflow.com/questions/21532856/how-to-generate-a-dataset-of-correlated-variables-with-different-distributions where advice was given by others to use copulas. The Statalist FAQ is quite explicit in requesting that posters tell us whenever they have cross-posted in other forums. Cross-posting is fine, but telling us about it is clearly good practice. Nick njcoxstata@gmail.com On 5 February 2014 10:33, Hauck, Katharina D <k.hauck@imperial.ac.uk> wrote: > For teaching purposes, I have to generate eight datasets of correlated > random variables with different distributions. Correlations, means and SD > of all variables have to be the same across datasets. I am using the > corr2data command but I have several issues: First, I cannot generate > discrete variables (or only with messy recoding afterwards), I cannot set > max and min values for the generated variables (again, requiring messy > recoding afterwards), and I seem to make a mistake with the correlation > matrix because when I check correlations after generation they are not > what they should be. Any tips for handling this command, or suggestions on > alternative commands? I am considering doing this all in MatLab, again, > any experiences highly welcome. > * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/