Search
   >> Home >> Products >> Features >> Functions

Functions

Statistical functions

  • Beta and noncentral beta distributions
    • Cumulative beta distribution
    • Probability density of the beta distribution
    • Right-tailed beta distribution
    • Inverse cumulative beta distribution
    • Inverse of the right-tailed distribution
    • Cumulative noncentral beta distribution
    • Probability density of the noncentral beta distribution
    • Inverse cumulative noncentral beta distribution
  • Binomial distribution
    • Cumulative binomial distribution
    • Probability mass of the binomial distribution
    • Right-tailed binomial distribution
    • Inverse cumulative binomial distribution
    • Inverse of the right-tailed binomial distribution
  • Chi-squared distribution
    • Cumulative chi-squared distribution
    • Probability density of chi-squared distribution
    • Right-tailed chi-squared distribution
    • Inverse cumulative chi-squared distribution
    • Inverse of the right-tailed chi-squared distribution
  • Noncentral chi-squared distribution
    • Cumulative noncentral chi-squared distribution
    • Inverse cumulative noncentral chi-squared distribution
    • Noncentrality parameter of the noncentral chi-squared distribution
    • Probability density of noncentral chi-squared distribution New
    • Reverse cumulative noncentral chi-squared distribution New
    • Inverse of reverse cumulative noncentral chi-squared distribution New
  • Dunnett's multiple range
    • Cumulative Dunnett's multiple range distribution
    • Inverse cumulative Dunnett's multiple range distribution
  • F and noncentral F distributions
    • Cumulative F distribution
    • Probability density of the F distribution
    • Right-tailed F distribution
    • Inverse cumulative F distribution
    • Inverse of the right-tailed distribution
    • Cumulative noncentral F distribution
    • Probability density of the noncentral F
    • Right-tailed noncentral F distribution
    • Inverse reverse cumulative noncentral F distribution
    • Noncentrality parameter of the noncentral F distribution
  • Gamma distribution
    • Cumulative gamma distribution
    • Probability density of the gamma distribution
    • Right-tailed gamma distribution
    • Inverse cumulative gamma distribution
    • Inverse of the right-tailed distribution
    • Partial derivatives of the cumulative gamma distribution
    • Second partial derivatives of the cumulative gamma distribution
  • Hypergeometric distribution
    • Cumulative hypergeometric distribution
    • Probability mass of the hypergeometric distribution
  • Negative binomial distribution
    • Cumulative negative binomial distribution
    • Probability mass function of the negative binomial distribution
    • Right-tailed negative binomial distribution
    • Inverse cumulative negative binomial distribution
    • Inverse of the right-tailed negative binomial distribution
  • Normal, log of the normal, and binormal distributions
    • Cumulative bivariate normal distribution
    • Cumulative standard normal distribution
    • Probability density of the normal distribution
    • Inverse cumulative standard normal distribution
    • Log of the cumulative standard normal distribution
    • Log of the probability density of the normal distribution
  • Poisson distribution
    • Cumulative Poisson distribution
    • Probability mass of the Poisson distribution
    • Right-tailed Poisson distribution
    • Inverse cumulative Poisson distribution
    • Inverse of the right-tailed Poisson distribution
  • Student's t and noncentral Student's t distributions
    • Cumulative Student's t distribution
    • Robability density of the Student's t distribution
    • Right-tailed Student's t distribution
    • Inverse cumulative Student's t distribution
    • Inverse of the right-tailed Student's t distribution
    • Cumulative noncentral Student's t distribution
    • Probability density of the noncentral Student's t distribution
    • Right-tailed noncentral Student's t distribution
    • Inverse of the right-tailed noncentral Student's t distribution
    • Noncentrality parameter of the noncentral Student's t distribution
  • Tukey's Studentized range
    • Cumulative Tukey's Studentized range distribution
    • Inverse cumulative Tukey's Studentized range distribution

Time-series functions

  • Return whether time is within a specified range, excluding the range's endpoints
  • Return whether time is within a specified range, including the range's endpoints

Date and time functions

  • Complete suite of functions for manipulating dates and datetimes, including support for business calendars and leap seconds
  • Convert dates and datetimes in string form to numeric form with great flexibility, including support for any order of year, month, day, hour, minute, second, and millisecond
  • Extract day, day of week, week of year, month, quarter, half-year, or year from specified date
  • Extract hour, minute, second, or millisecond from specified time or datetime, including optional adjustments for leap seconds
  • Convert between units of date and time
  • Convert between business dates and regular dates

Matrix functions

Stata has a powerful matrix language called Mata that contains hundreds of functions.

Below, we list some basic matrix functions that are provided within Stata. All of the same functionality, and more, is provided in Mata too. Mata is included with Stata.

  • Determinant of matrix
  • Trace of matrix
  • Number of rows of matrix
  • Number of columns of matrix
  • Number of zeros on diagonal of matrix
  • Floor of matrix element
  • Check if matrix is symmetric
  • Check for missing elements in matrix
  • Relative difference of two matrices
  • Column number associated with specified column name
  • Row number associated with specified row name
  • Identity matrix
  • Inverse of matrix
  • Cholesky decomposition
  • Hadamard matrix
  • Sweep matrix
  • Correlation matrix of variance matrix
  • Diagonal matrix from vector
  • r x c matrix with each element equal to z
  • r x c matrix with elements containing uniformly distributed pseudorandom numbers in [0,1]
  • Column vector from matrix

Random-number functions

  • Uniform
  • Standard normal
  • Normal, mean m and std. deviation 1
  • Normal, mean m and std. deviation s
  • eta
  • Binomial
  • Chi-squared
  • gamma
  • Hypergeometric
  • Negative binomial
  • Poisson
  • Student's t

Mathematical functions

  • Programming functions
    • Absolute value
    • Ceiling
    • Combinatorial
    • Floor
    • Maximum
    • Minimum
    • Modulus
    • Relative difference
    • Round of x in units of y
    • Running sum
    • Sign
    • Truncation
  • Common transcendental functions
    • Natural logarithm
    • Base-10 logarithm
    • Exponential
    • Natural log of n factorial
    • Complementary log-log
    • Inverse of the complementary log-log
    • Logit
    • Inverse of the logit
    • Square root
    • Natural log of gamma
    • digamma
    • trigamma
  • Trigonometric functions
    • Sine of radians
    • Cosine of radians
    • Tangent of radians
    • Arcsine returning radians
    • Arccosine returning radians
    • Arctangent returning radians
    • Two-argument arctangent
    • Inverse hyperbolic sine
    • Inverse hyperbolic cosine
    • Inverse hyperbolic tangent
    • Hyperbolic sine
    • Hyperbolic cosine
    • Hyperbolic tangent

String functions

  • Abbreviation
  • Concatenation
  • Duplication
  • Reduce multiple, consecutive internal blanks to one blank
  • Remove leading blanks
  • Remove trailing blanks
  • Remove both leading and trailing blanks
  • Lowercase string
  • Convert string to "proper" case
  • Uppercase string
  • Pluralize string
  • Eeversed string
  • Substitution of characters for pattern found in string
  • Substitution of characters for word found in string
  • Extract substring
  • Length of string
  • Position of first character in string in list of match characters
  • Position of first character in string not in list of match characters
  • Position of string in another string
  • nth word of string
  • Number of words in string
  • Convert string to numeric
  • Convert numeric to string
  • Regular expression pattern matching
  • Regular expression pattern replacement
  • Regular expression pattern subexpressions
  • Convert string to valid Stata name
  • Wildcard pattern matching
  • ASCII character for decimal number
  • Soundex code for string
  • U.S. Census soundex code for string

Low-level programming functions

  • Partition interval into n equal-length intervals
  • Recode number into one of several specified categories
  • Byte order of computer architecture on which Stata is currently running
  • Version of caller of currently running program to assist with backward compatibility version control
  • Round if rounding does not exceed specified tolerance
  • Convert number to single-precision floating-point value
  • Restrict returned value to a range
  • Conditional function to return one value if argument is true and another value if argument is false
  • Check for any missing value in set or arguments
  • Access to system parameters, system constants, and current setting values
  • Access to results of Stata commands
  • Return whether observation is in estimation subsample
  • Check whether value is in a list of arguments, string or numeric
  • Check whether value lies within a specified range of numbers or strings
  • Return maximum output width for value displayed with specified display format
  • Access to machine precision of double- and single-precision floating-point numbers
  • Access to cutoff value for normalized/denormalized IEEE double-precision floating point numbers
  • Access to largest and smallest possible values of each numeric Stata variable storage type
  • Read contents of file into string
  • Write string to file
  • Check whether file exists

See New in Stata 13 for more about what was added in Stata 13.

The Stata Blog: Not Elsewhere Classified Find us on Facebook Follow us on Twitter LinkedIn Google+ Watch us on YouTube