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

st: RE: Re: Confidence Intervals


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Re: Confidence Intervals
Date   Tue, 6 May 2003 09:48:55 +0100

victor michael zammit

> 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

It depends on your standards of proof, but 
I don't know any standard which would make 
your results a proof. 

Your test is simultaneously testing 
at least four things: 

1. Stata's competence in programming functions
for the normal. 

2. Ditto, random numbers. 

3. How well finite sample results behave. 

4. Your competence in programming. 

On the last, your program looks fine 
to me on what it does, but what seems closest 
to your question is 1., which is more directly answered by e.g. 

. di norm(1) - norm(-1) 

Nick 
[email protected] 
*
*   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