Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: RE: drawnorm equivalent for different distribution types?
From
"Feiveson, Alan H. (JSC-SK311)" <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: RE: drawnorm equivalent for different distribution types?
Date
Tue, 3 Sep 2013 14:49:05 +0000
Ariel - If you wanted to generate correlated RV's from a specific continuous distribution you could do this with a copula transformation:
1. Use drawnorm N(0, R) to get X1, x2, etc . where R is a specified correlation matrix.
2. Transform to a "copula" - i.e. dependent uniforms by U1 = normal(X1), U2 = normal(X2), etc.
3. Transform U's to distribution of choice using inverse CDF: Y1 = invcdf(U1), Y2 = invcdf(U2). For example to transform to correlated gammas, use "invcdf()" as invgammap().
4. The problem is however that the correlations between the Y's will never be as "high" (i.e. in absolute value) as the correlations in R. I believe it can be proved that only if the Ys are multivariate normal, will the correlations come out the same. However you could experiment by making the correlations in R somewhat higher than what you really want so that the correlations of the Y's is approximately what you want.
Al Feiveson
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Ariel Linden, DrPH
Sent: Sunday, September 01, 2013 3:22 PM
To: [email protected]
Subject: st: drawnorm equivalent for different distribution types?
Hi All,
Is there an equivalent to -drawnorm- for different distribution types? So for example, let's say I wanted two Poisson distributed variables with a correlation of 0.50? Or a chi-sq distribution, etc...
Thanks!
Ariel
*
* 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/
*
* 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/