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

Re: st: Generating a logistically distributed random variable.


From   Antoine Terracol <[email protected]>
To   [email protected]
Subject   Re: st: Generating a logistically distributed random variable.
Date   Mon, 19 Aug 2002 17:36:00 +0200

Hello.

To generate standard random logistic variables, you can use the following code (to be saved as drawlogit.ado in your personal ado files directory):

cap prog drop drawlogit
program define drawlogit
version 7.0
syntax newvarlist [if] [in] [, double]
tokenize "`varlist'"
while "`1'"!="" {
g `double' `1' =ln(1/uniform()-1) `if' `in'
mac shift
}
end


alternatively, and for more general distributions, see the --rnd- suite (findit rnd)

Hope this helps,
Antoine


[email protected] wrote:


To generate a normal (0,1) random variable you use invnorm(uniform()). How do you generate a random variable that is logistically distributed?

Sincerely, Eric Powers
---
[This E-mail scanned for viruses by Declude Virus]

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