Bookmark and Share

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]

Re: st: generate random data referring to given covariance matrix


From   Maarten Buis <[email protected]>
To   [email protected]
Subject   Re: st: generate random data referring to given covariance matrix
Date   Tue, 27 Aug 2013 09:41:03 +0200

On Tue, Aug 27, 2013 at 5:42 AM, Rubi Lam wrote:
> - how to save the covariance matrix or the covariance data in Stata?
>
> - how to generate random data for the variables referring to the saved
> covariance matrix?

The covariance matrix alone does not uniquely identify the
distribution from which you want to draw your data, and without such a
distribution you cannot do what you want to do. I will assume you want
to draw from a multivariate normal distribution and that you also have
a vector of means (or that you are OK with arbitrarily fixing them at
0). In that case, you can use the -drawnorm- command, see: -help
drawnorm-.

-- Maarten

---------------------------------
Maarten L. Buis
WZB
Reichpietschufer 50
10785 Berlin
Germany

http://www.maartenbuis.nl
---------------------------------
*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index