__1__ Data was simulated (Box-Muller) as X~N(0,1): 100, sample mean mx evaluated, __2__ Test Statistics z= mx/sqrt(1/n) . The null: | z | < z0= 1.959964 the CI bonds relative to the Probability inside 95% , Normal Distribution.
Why I didn´t consider the Student´s paradigm for the means of Normal/Gaussian samples? Am I wrong? Not at all (instead I had yet found here criticizing people for similar situations). Simply z expression indicates clearly that I took into account that ´I know´ that the Population standard deviation is 1 . . . Are you skeptics? Do perform the routine with, say n=10, and you will find the same 95 (as I did). Now a challenge can be posed . . . What happened though I deliberate to ignore that the standard deviation is 1? Simply we change __1) the test statistic, with ssd= sum of squares deviations, t= mx /sqrt (stdev/n) , stdev= ssd/(n-1) __2) we read on a table (or software) the bounds relative to the Student Distribution and modify accordingly the routine at this point: for n=100, and 95% probability, the CI turns out [-1.984217, 1.984217]. Luis A. Afonso
FOR t = 1 TO 20 pi = 4 * ATN(1) FOR rpt = 1 TO 200 LOCATE 5, 40 PRINT USING "######"; 200 - rpt RANDOMIZE TIMER outt = 0 FOR j = 1 TO 100 mx = 0 FOR ix = 1 TO n 1 ru = RND IF ru < 1E-08 THEN GOTO 1 x = SQR(-2 * LOG(ru)) * COS(2 * pi * RND) mx = mx + x / n NEXT ix z = mx / SQR(1 / n) COLOR 7 IF ABS(z) >= cutt THEN GOTO 4 outt = outt + 1 4 NEXT j mean = mean + outt / 200 trial = trial + 1 NEXT rpt PRINT : PRINT LOCATE 7 + 2 * t, 40 PRINT USING "### ###.## ###### "; t; mean / t; trial NEXT t END