Statalist


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

st: AW: degenerate normal (mild annoyance)


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: AW: degenerate normal (mild annoyance)
Date   Fri, 21 Aug 2009 17:44:49 +0200

<>

" Does anyone with Stata 11 get the same result?"


Yes, I do end up with a thousand zeroes after this code in Stata 11:


******
clear
set obs 1000
gen x=rnormal(100,0)
l
******


HTH
Martin

-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Feiveson, Alan
H. (JSC-SK311)
Gesendet: Freitag, 21. August 2009 15:51
An: [email protected]
Betreff: st: degenerate normal (mild annoyance)

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/


*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index