# st: R: Gamma functions in R and Stata's Gamma Functions

 From "Carlo Lazzaro" To Subject st: R: Gamma functions in R and Stata's Gamma Functions Date Fri, 7 Mar 2008 19:14:12 +0100

```Dear Tiago,
I would suggest you to take a look at what follows:
------------------------------------------------------
http://www.stata.com/help.cgi?density+functions

gammap(a,x)
Domain a:     1e-10 to 1e+17
Domain x:     -8e+307 to 8e+307
Interesting domain is x > 0
Range:        0 to 1
Description:  returns the cumulative gamma distribution with shape
parameter a.
returns 0 if x < 0.

The cumulative Poisson (the probability of observing k
or fewer events if the expected is x) can be evaluated
as 1-gammap(k+1,x). The reverse cumulative (the
probability of observing k or more events) can be
evaluated as gammap(k,x).
****************************************************************************
gammap() is also known as the incomplete gamma function
(ratio).
****************************************************************************

Probabilities for the three-parameter gamma
distribution
(see gammaden() can be calculated by shifting and
scaling x; i.e., gammap(a,(x - g)/b).
-------------------------------------------------------------------------

Kind Regards,

Carlo
-----Messaggio originale-----
Da: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Per conto di
tiago.pereira@incor.usp.br
Inviato: venerd́ 7 marzo 2008 17.50
A: statalist@hsphsun2.harvard.edu
Oggetto: st: Gamma functions in R and Stata's Gamma Functions

Dear All,

I am trying to implement a test that requires the incomplete gamma function.

The R code is given by

example<- pgamma(Z, shape=X,rate=Y)

where Z is the critical value for a chi^2 distribution. I am not very
experienced with this distribution, and failed to find out the
corresponding counterpart in Stata. Hence, would it be possivle to you to
provide me some tips to implement it in Stata?

Tiago

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