Stata
Products Purchase Support Company
Search
   >> Home >> Resources & support >> FAQs >> Calculating the Euler–Mascheroni constant Bookmark and Share

How do I get the Euler–Mascheroni constant gamma = 0.57721... in Stata?

Title   Calculating the Euler–Mascheroni constant
Author Nicholas J. Cox, Durham University, UK
Date December 2003; minor revisions January 2006

The Euler–Mascheroni constant gamma = 0.57721 ... is one of the most important constants in mathematics. For some background, see Havil (2003) and/or Finch (2003, 28–40). In statistics, gamma arises, for example, in the theory of certain probability distributions.

In Stata, gamma can be calculated using the function digamma() as −digamma(1) (note the negative sign). For example,

        . di %12.10f −digamma(1) 

yields 0.5772156649. See also help math functions for details about related functions.

References

Finch, S. R. 2003. Mathematical Constants.
Cambridge: Cambridge University Press.
Havil, J. 2003. Gamma: Exploring Euler's Constant.
Princeton: Princeton University Press.
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
Resources & support
FAQs
Technical support
NetCourses
Short courses
Users Group meetings
Statalist
Links
Software updates
Software archives
Customer service
Manuals & supplements
Stata Journal
STB
Stata News
Stata Automation
Plugins

Site overview
Products
Resources & support
Company
Site index

© Copyright 1996–2009 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index