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 at the end of May, and its replacement, statalist.org is already up and running.


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

st: How to compute with Stata probabilities by conditioning ?


From   "Tiago V. Pereira" <tiago.pereira@mbe.bio.br>
To   statalist@hsphsun2.harvard.edu
Subject   st: How to compute with Stata probabilities by conditioning ?
Date   Fri, 17 May 2013 11:52:17 -0300 (BRT)

Dear statalisters,

Imagine two standard normal variables, X and Y, with known correlation, rho.

P(X>t1|Y>t2) can be computed with

binormal(t1,t2,rho)

What if we were interest in computing

P(X>t1 and Y>t2) ?

Since X and Y are correlated, I am a bit confused.

I am using brute force (dumb way):

set obs 1000000000
matrix M = (1,rho \ rho, 1)
drawnorm x y, means(0 0) sds(1 1) corr(M)
count if x>t1&y>t2

P(X>t1 and Y>t2)  = r(N)/_N

Is there a smarter way of computing probabilities by conditioning (with
Stata)?

Thanks in advance.

Tiago


*
*   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