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" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
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 
n.j.cox@durham.ac.uk 

> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu]On Behalf Of 
> R.E. De Hoyos
> Sent: 02 June 2004 19:10
> To: statalist@hsphsun2.harvard.edu
> 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index