Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Question regarding Gamma distribution and its implementation


From   "Feiveson, Alan H. \(JSC-SK311\)" <alan.h.feiveson@nasa.gov>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Question regarding Gamma distribution and its implementation
Date   Fri, 29 Sep 2006 13:48:04 -0500

Tiago - I think what you want is 1-gammap(y,z*c); i.e. in Stata, type

gen q = 1-gammap(y,z*c)

assuming y,c and z are defined Stata variables in your data set.


 I am assuming there is a typo in the denominator of your constant. Should it not be ((z^y)/(gamma(y))  ?

Al Feiveson

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of tiago.pereira@incor.usp.br
Sent: Friday, September 29, 2006 1:35 PM
To: statalist@hsphsun2.harvard.edu
Subject: st: Question regarding Gamma distribution and its implementation

Dear all,

I´m geneticist. Hence, sorry for the dummy questions.

I have to generate a new variable using a set of parameters.

The new variable is generated as follows:

((z^y)/(gamma(y,z)))* integral of x^y-1 * exp^-zx dx from c to infinity, where

z, y, c  are values previously calculated

gamma is the Gamma distribution with parameters y and z.

How do I implement such formula using Stata?

I have already checked "functions" commands, but still feel unsure regarding the correct implementation.

I´ll be glad for any help. Thanks in advance.



Tiago


--
Tiago V. Pereira
Heart Institute - InCor
Laboratory of Cardiovascular Genetics
Federal University of São Paulo
University of São Paulo Medical School
Av. Dr. Eneas de Carvalho Aguiar, 44;
Cerqueira César - CEP 05403-000
Sao Paulo, SP Brazil.
Tel./fax: +55 11 3069 5068
email:  tiago.pereira@incor.usp.br



*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index