# st: Question about -drawnorm- for two normally distributed variables

 From tiago.pereira@incor.usp.br To statalist@hsphsun2.harvard.edu Subject st: Question about -drawnorm- for two normally distributed variables Date Tue, 18 Mar 2008 13:23:12 -0300 (BRT)

```Dear all,

I just want to generate two means which are modelled as being bivariate
normally distributed. However, I am not 100% sure regarding doing that in
Stata.

I have to simulate two variables (mean+-standard deviation, respectively:

variable 1 = 125+-50 mg/dl
variable 2 = 120+-25 mg/dl

covariance = 0.7

In this respect, I am using the following code:

clear
matrix C = (25, 0.7\ 0.7, 50)
matrix m = (125,120)
drawnorm cholesterol1 cholesterol2, n(100) means (m) cov(C)

My question is: is that correct? when I type

corr cholesterol1 cholesterol2, covar

the estimated covariance (for 10^6 simulated values) is far away from the
inputed 0.7 value.

For instance:

| choles~1 choles~2
-------------+------------------
cholesterol1 |  24.9746
cholesterol2 |  .655911  49.9338

(for 1000000 simulated values)

Is that normal or am I doing something wrong?

Tiago

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```