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: [email protected] [mailto:[email protected]] On Behalf Of [email protected]
Sent: Friday, September 29, 2006 1:35 PM
To: [email protected]
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: [email protected]
*
* 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/