Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down at the end of May, and its replacement, **statalist.org** is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
Nick Cox <n.j.cox@durham.ac.uk> |

To |
"'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu> |

Subject |
st: RE: How to generate a random variable with PDF gamma(a,b,g,x) |

Date |
Mon, 13 Jun 2011 20:28:34 +0100 |

I don't know how the uniform distribution comes into this. Isn't it just a translation of a two-parameter distribution: gen y = 0.8 + rgamma(3, 0.04) ? Nick n.j.cox@durham.ac.uk Tiago V. Pereira I would like to generate a gamma random variable with probability density function given by gamma(a,b,g,x) where a = 3 (shape), b = 0.04 (scale), g = 0.80 (location). I believe that the trick is to generate x correctly from a uniform distribution, since I am looking at x>g only. The pdf should look like this: http://tinypic.com/r/5yrxgg/7 * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**References**:**RE: st: Constrained Regression in Stata***From:*"Tiago V. Pereira" <tiago.pereira@mbe.bio.br>

**st: How to generate a random variable with PDF gamma(a,b,g,x)***From:*"Tiago V. Pereira" <tiago.pereira@mbe.bio.br>

- Prev by Date:
**st: How to generate a random variable with PDF gamma(a,b,g,x)** - Next by Date:
**Re: st: Twitter Message Sub-string Extraction?** - Previous by thread:
**st: How to generate a random variable with PDF gamma(a,b,g,x)** - Next by thread:
**st: -mi- Suite and Robust Standard Errors?** - Index(es):