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

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


From   [email protected]
To   [email protected]
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"
                    exit
            }
            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) 
end

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,

Amani
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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