Statalist


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

st: censored random normal with a fixed mean and standard deviation


From   Scott Merryman <[email protected]>
To   [email protected]
Subject   st: censored random normal with a fixed mean and standard deviation
Date   Tue, 20 Oct 2009 13:48:03 -0500

In generating censored random normal variate with a fixed mean and
standard deviation is there a way to determine what the mean and
standard deviation should be for the uncensored normal.

For exmaple, if one wants a cenored normal (at 0) with mean 25 and
standard deviation 30, then

 -gen yield = max(0, rnormal(25,30))-

will result in a mean too large and standard deviation too small.  In
this example values of -rnormal(13.5,43.75)- work, but is there way to
determine what the uncensored mean and standard deviation should be?

clear
set obs 1000000
set seed 123456
gen yield1 = max(0, rnormal(25,30))
gen yield2 = max(0, rnormal(13.5,43.75))
sum


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