Difference of two normal means – no equal sigmas
- From: "\"Luis A. Afonso\"" <licas_@xxxxxxxxxxx>
- Date: Thu, 05 May 2005 19:00:18 EDT
The formulas to test the difference of two means does not work if the Populations have different standard deviations even if both are normal.
Sample X : mean=xbar, size=nX,
[xx]= sum of the squares
Sample Y : mean=ybar, size=nY,
[yy]= sum of the squares
Formulas (to read te program is advised in order to understand all the process)
t0=(xbar-ybar)/s =
=(xbar-ybar)/sqrt[sqd/(nX+nY-2)
*(1/nX + 1/ nY)]
sqd=[xx] – nx*(xbar^2)
+ [yy] – nY*(ybar^2)
here are the results
a)
X=N(0,1)size=10
Y=N(0,1)size=10
95% CI 99%
-2.079__2.101____-2.836__2.879
-2.095__2.099____-2.882__2.895
-2.091__2.106____-2.849__2.888
-2.090__2.094____-2.892__2.874
-2.109__2.103____-2.888__2.899
means (absolute values) and theirs errors
95%CI=2.097+/-0.003
99%CI=2.878+/-0.006
b)Y=N(0,2)N=10
95% CI 99%
-2.153__2.148____-2.976__2.988
-2.163__2.134____-3.007__2.975
-2.154__2.154____-2.989__3.014
-2.163__2.142____-3.017__2.990
-2.149__2.155____-2.981__2.974
means and errors
95%CI=2.152+/-0.003
99%CI=2.991+/-0.005
c)Y=N(0,5)size=10
95% CI 99%
-2.221__2.228____-3.177__3.245
-2.236__2.242____-3.178__3.173
-2.225__2.234____-3.160__3.174
-2.220__2.241____-3.152__3.174
-2.240__2.222____-3.193__3.189
means and errors
95%CI=2.231+/-0.003
99%CI=3.181+/-0.008
..
d)Y(0,10)size=10
95% CI 99%
-2.246__2.251____-3.249__3.275
-2.254__2.270____-3.227__3.245
-2.269__2.254____-3.186__3.199
-2.253__2.245____-3.256__3.200
-2.242__2.254____-3.188__3.296
means and errors
95%CI=2.254+/-0.003
99%CI=3.232+/-0.012
If the two Populations have largely different standard deviations the CI are progressively larger than the <standard ones> (i.e. those corresponding to equal dispersions). One risk TO REJECT H0 (not distinguishable means) wrongly using Students with nX+nY-2 df. On the contrary if the test accepted H0 there is no problem.
(I can only provide <facts> and procedures, not doctrine, numerical examples, not academic texts. In what that concerns my English I do my best)
REM "AKAY-1b"
CLS
pi = 4 * ATN(1)
RANDOMIZE TIMER
PRINT " X-Y normal independent "
PRINT " X ": INPUT " mX "; mx
INPUT " sX "; sx: INPUT " nX "; nx
PRINT " Y ": INPUT " mY "; my
INPUT " sY "; sy: INPUT " nY "; ny
DIM x(nx), y(ny), tem(14005)
FOR again = 1 TO 5
rpt = 100000: RANDOMIZE TIMER
FOR v = 1 TO rpt
x = 0: y = 0: xx = 0: yy = 0
FOR ix = 1 TO nx
a = SQR(-2 * LOG(RND)): rr = RND
x(ix) = mx + sx * a * COS(2 * pi * rr)
x = x + x(ix) / nx
xx = xx + x(ix) * x(ix): NEXT ix
FOR iy = 1 TO ny
a = SQR(-2 * LOG(RND)): rr = RND
y(iy) = my + sy * a * SIN(2 * pi * rr)
y = y + y(iy) / ny
yy = yy + y(iy) * y(iy): NEXT iy
nn = (1 / nx + 1 / ny) / (nx + ny - 2)
sqq = xx - nx * x * x
sqq = sqq + (yy - ny * y * y) * nn
z = (x - y) / SQR(sqq)
IF z > 7 THEN z = 7
IF z < -7 THEN z = -7
z = z + 7
zz = INT(1000 * z + .5)
tem(zz) = tem(zz) + 1
NEXT v
trav(1) = .025 * v: trav(2) = .975 * v
trav(3) = .005 * v: trav(4) = .995 * v
FOR yi = 1 TO 4: sa = 0
FOR i = 0 TO 14000
sa = sa + tem(i)
IF sa > trav(yi) THEN GOTO 12
NEXT i
12 w(teima) = i / 1000 - 7
PRINT USING " ###.### "; w(teima);
NEXT yi
PRINT : RANDOMIZE TIMER
FOR ii = 0 TO 14000: tem(ii) = 0: NEXT ii
NEXT again: END
Licas_@xxxxxxxxxxx
.
- Prev by Date: Re: Testing a Pseudo-Random Generator
- Next by Date: Alfonsoism (was Re: Testing a Pseudo-Random Generator)
- Previous by thread: Plz help me this probability prob
- Next by thread: Permutation and p-value again!
- Index(es):