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

st: generate a positive-valued random variable

From   "Jun Xu" <>
Subject   st: generate a positive-valued random variable
Date   Fri, 29 Apr 2005 15:17:20 -0500

I am still using Stata 8. I am trying to generate a positive-valued random variable, and I think I should turn to inverse gamma distribution. I am not sure if this is right (with its shape parameter equal to 6):

gen positivevar = invgamma(6, uniform())

I tried searching Stata listserv and FAQ and I might have missed it. But I suggest Stata could post some codes for creating commonly used random variables in its online FAQ section. I think that will be great for a lot of intermediate users.

Jun Xu
Department of Sociology
Indiana University

Donít just search. Find. Check out the new MSN Search!

* For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index