Statalist


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

st: degenerate normal (mild annoyance)


From   "Feiveson, Alan H. (JSC-SK311)" <alan.h.feiveson@nasa.gov>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: degenerate normal (mild annoyance)
Date   Fri, 21 Aug 2009 08:51:19 -0500

Hi - In Stata 10, I just noticed that the function -rnormal(mu,sig)- returns all missing values when sig = 0. I consider this a bug, since sometimes for debugging purposes it is convenient to set a particular variance component to zero. In other words, I would want -rnormal(mu,sig) to return a variable with all values equal to the `mu' when `sig' = 0. 

Of course, I don't have to use "rnormal" notation and could just as well used statements such as 

gen y = `sig'*rnormal(0,1) +`mu'

in my programs. But then why even bother with the "rnormal( , )" command?

(Buy the way, -drawnorm- does provide the correct output when the covariance matrix is all zeros.)

Does anyone with Stata 11 get the same result?


Al Feiveson

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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