Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.


Luis A. Afonso
Posts:
4,758
From:
LIsbon (Portugal)
Registered:
2/16/05


Semiamplitude Confidence Intervals for the two normal difference means
Posted:
May 27, 2013 3:02 PM


Semiamplitude Confidence Intervals for the two normal difference means
With normal data X~N(muX, sigma): nX, Y~N(muY, sigma): nY whatever the sample sizes nX, nY , the C.I. for D= muXmuY is obtained from:
Obsvdiff  t0*s <= D <= Obsvdiff + t0*s
Where Obsvdiff is the observed difference of the sample mean values, t0(1 alpha/2) is the student T value nX+nY2 degrees of freedom, and s is such that s0^2 = (ssdX+ssdY)/(nX+nY2) *(1/nX+1/nY) ssd= sum of squared deviations.
For alpha= 0.05, twotails, Sample sizes______CI semiamplitude __5,5____________2.160_______ _10,10___________1.244_______ _15,15___________0.943_______ _20,20___________0.784_______ _25,25___________0.682_______ _30,30___________0.611_______
The T values were 2.306, 2.011, 2.048, 2.024, 2.011, 2.002, respectively. Aim: these evaluations do show how large should be the samples in order that a given difference on observed sample means can be ascribed to differences on Populations and not to unavoidable random fluctuations. Luis A. Afonso REM "class2" CLS PRINT " < class2 > " DEFDBL AZ DIM ww(8001) INPUT " nX, nY (<= ) "; nX, nY pi = 4 * ATN(1) df = nX + nY  2 PRINT " df= "; df INPUT " Tstudent "; tst INPUT " How many "; many FOR rt = 1 TO 10 RANDOMIZE TIMER REM FOR rpt = 1 TO many REM mx = 0: xx = 0 FOR i = 1 TO nX aa = SQR(2 * LOG(RND)) x = 0 + aa * COS(2 * pi * RND) mx = mx + x / nX xx = xx + x * x NEXT i sqdX = xx  nX * mx * mx my = 0: yy = 0 FOR i = 1 TO nY aa = SQR(2 * LOG(RND)) Y = 0 + aa * COS(2 * pi * RND) my = my + Y / nY yy = yy + Y * Y NEXT i sqdY = yy  nY * my * my sqd = sqdX + sqdY uW = SQR(sqd / (nX + nY  2)) * SQR(1 / nX + 1 / nY) uW = tst * uW uu = INT(uW * 1000 + .5) IF uu > 8000 THEN uu = 8000 ww(uu) = ww(uu) + 1 / many NEXT rpt g = .975 sw = 0 FOR t = 0 TO 8000 sw = sw + ww(t) IF sw > g THEN GOTO 14 NEXT t 14 PRINT USING " #.### "; t / 1000; sw REM xi = t / 1000 mix = mix + xi / 10 xxi = xxi + xi * xi FOR tt = 0 TO 8001: ww(tt) = 0: NEXT tt NEXT rt REM ssdi = xxi  10 * mix * mix v = ssdi / (10 * 9) e = SQR(v / 9) PRINT USING " mean #.### "; mix; PRINT USING "+/ #.### "; e END



