|
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: Sampling from a t-distribution using Stata
From
"Stas Kolenikov" <[email protected]>
To
[email protected]
Subject
Re: st: Sampling from a t-distribution 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(_N-3), uniform()
)/ (_N-3) )
On 6/4/07, Stas Kolenikov <[email protected]> wrote:
How about
g double t = m + sd* invnorm(uniform())/sqrt( invchi2(_N-3), uniform() )
On 6/4/07, [email protected] <[email protected]> wrote:
> Dear statalisters,
>
> I would like to generate a new variable called "x", in which "x" has a
> t-distribution with n-3 degrees of freedom (where n is the number of new
> generated observations), a mean "m" and a standard deviation, "sd", that
> is:
>
> x ~ t-distribution[n-3 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–2024 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |