
From  "Stas Kolenikov" <skolenik@gmail.com> 
To  statalist@hsphsun2.harvard.edu 
Subject  Re: st: Sampling from a tdistribution using Stata 
Date  Mon, 4 Jun 2007 16:17:52 0500 
Oops. Forgot the degrees of freedom: g double t = m + sd* invnorm(uniform())/sqrt( invchi2(_N3), uniform() )/ (_N3) ) On 6/4/07, Stas Kolenikov <skolenik@gmail.com> wrote:
How about g double t = m + sd* invnorm(uniform())/sqrt( invchi2(_N3), uniform() ) On 6/4/07, tiago.pereira@incor.usp.br <tiago.pereira@incor.usp.br> wrote: > Dear statalisters, > > I would like to generate a new variable called "x", in which "x" has a > tdistribution with n3 degrees of freedom (where n is the number of new > generated observations), a mean "m" and a standard deviation, "sd", that > is: > > x ~ tdistribution[n3 df] (m, sd) > > How do I obtain a set of 100 new observations assuming that m=0.4 and > sd=0.05 using Stata? > > I will be very grateful for any help.
 Stas Kolenikov http://stas.kolenikov.name * * 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–2016 StataCorp LP  Terms of use  Privacy  Contact us  What's new  Site index 