Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: defining a covariance matrix


From   "Ariel Linden, DrPH" <ariel.linden@gmail.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: defining a covariance matrix
Date   Wed, 1 May 2013 14:21:55 -0400

Hi All,

I am trying to replicate some analyses from a paper, and I came across the following sentence:

"X1, X2, and X3 are multivariate normal with means zero, variances of (2, 1, 1) and covariances of (1,−1,−0.5) respectively."

Can someone tell me how to define the covariance matrix  as described above? This rest is easy enough:

*** code****
matrix m = (0,0,0)
matrix sd = (sqrt(2),1,1)
matrix C = ?
drawnorm X1 X2 X3, n(1000) means(m) sds(sd) cov(C)

Thanks in advance

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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index