Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: random number with a specific variance


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: random number with a specific variance
Date   Wed, 2 Jun 2004 19:16:08 +0100

gen answer = mean + sqrt(var) * invnorm(uniform()) 

Nick 
[email protected] 

> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]]On Behalf Of 
> R.E. De Hoyos
> Sent: 02 June 2004 19:10
> To: [email protected]
> Subject: st: random number with a specific variance
> 
> 
> Hi,
> 
> How can I generate a variable containing random numbers 
> normally distributed
> and a variance different from 1 (like -invnorm(uniform())- but with a
> variance different from one)?
> 
> Thanks,
> 
> Rafa
> *
> *   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/
> 

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