Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

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 14:06:58 -0300 (BRT)

Thank you so much, Austin!

>Your code doesn't match your stated desiderata:

Yes!, my bad !

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


>Sampling variation is normal; if you want to match .7 exactly use

my bad again!

Definitely, sampling variability will not provide exact values. However,
simulating a large number of observations will provide very close estimates.
But the problem it that I was simulating with a non-updated do-file (with
n=10).
Simulations with 10000000 indeed provide a covariance very close to that
inputed.


. corr cholesterol1 cholesterol2, covar
(obs=10000000)

             | choles~1 choles~2
-------------+------------------
cholesterol1 |  25.0221
cholesterol2 |  .697355  49.9838
*
*   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/



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