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

st: Re: Confidence Intervals


From   "victor michael zammit" <[email protected]>
To   <[email protected]>
Subject   st: Re: Confidence Intervals
Date   Sun, 4 May 2003 21:41:44 +0200

Dear All,
it is claimed  that ,given a normally distributed variable :
    mean minus 1 sd   to   mean plus  1 sd  contains 68.26% of observations
     "          "       2  "     "       "       "      2   "     "
95.54%  "   "
     "          "      3    "    "      "       "       3   "    "
99.74%  "    "
I would like to know if the following is a good enough proof of the claim



. program define interval
  1. quietly {
  2. drop _all
  3. set obs 100000
  4. gen x = invnorm(uniform())*`1' + 200
  5. count if x>= `2' &`3' >=x
  6. }
  7. di r(N)/100000
  8. end

. interval 1 199 201
.68278

. interval 50 150 250
.68189

. interval 100 100 300
.68281

. interval 1 198 202
.95387

. interval 50 100 300
.95409

. interval 100 0 400
.95426

. interval 1 197 203
.99725

. interval 50 50 350
.99736

. interval 100 -100 500
.99718


*
*   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