Stata: Data Analysis and Statistical Software
   >> Home >> Resources & support >> FAQs >> Calculating the beta function

How do I calculate values of the beta function?

Title   Calculating the beta function
Author Nicholas J. Cox, Durham University, UK
Date November 2001

The beta function can be defined in terms of the gamma function and thus, calculated using the Stata functions exp() and lngamma(). On the latter, see help on math functions. Given arguments a and b, the beta function

        Β(a,b) = Γ(a) Γ(b) / Γ(a + b)

can be calculated from


        exp(lngamma(a) + lngamma(b) - lngamma(a + b))  

In this expression, each argument may be a number, a variable, or, more generally, itself an expression.

Bookmark and Share 
FAQs
What's new?
Statistics
Data management
Graphics
Programming Stata
Mata
Resources
Internet capabilities
Stata for Windows
Stata for Unix
Stata for Mac
Technical support
Like us on Facebook Follow us on Twitter Follow us on LinkedIn Google+ Watch us on YouTube
Follow us
© Copyright 1996–2013 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index   |   View mobile site