Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Inverse of the normal cumulative distribution

    Hello everyone,
    Given a value for probability, I would like to seek that value x such that F(x, mean, standard_dev) = probability, where F is defined as the normal cumulative distribution.
    I found that function invnormal(p) does this, but only works for the normal standard distribution (mean=0, sd=0). I would like to know if there is a function to do this in a general case (e.g. when the mean is not equal to zero and the standard deviation is not 1 )
    Thanks !

  • #2
    invnormal() only supports one argument because all you need otherwise is addition and/or multiplication. Suppose the mean is 1 and the SD is 2.

    Code:
    . di invnormal(0.75)
    .67448975
    
    . di 1 + 2 * invnormal(0.5)
    1
    
    . di 1 + 2 * invnormal(0.75)
    2.3489795
    This works for variables too in (e.g.) a generate statement.

    Comment

    Working...
    X