Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: The function " invnorm(uniform())"

Subject   st: The function " invnorm(uniform())"
Date   Thu, 24 Apr 2003 13:33:33 +0200

Dear Listers,

I am using the function "invnorm(uniform())" which returns normally
distributed random numbers with mean        zero and standard deviation one,
inside a program "linsim.ado".    The latter is used with:

simul linsim, reps(10000)

program define lnsim
            version 7.0
            if "`1'"=="?" {
                    global S_1 "eff diag1 diag2"
            drop _all
            set obs 1
            gen eff = uniform()*100
            gen diag1 = invnorm(uniform())
            gen diag2 = invnorm(uniform())*1.5 + 5
            post `1' (eff) (diag1) (diag2) 

Can I say that the variable "diag2", is a normally distributed random number
with mean 5 and standard deviation 1.5.

Many thanks for your help in advance.

Best regards,

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index