Re: Comparing fractions (or proportions)
- From: "\"Luis A. Afonso\"" <licas_@xxxxxxxxxxx>
- Date: Wed, 27 Dec 2006 14:45:09 EST
OMU wrote:
*** Date: Dec 27, 2006 9:55 AM
Author: Old Mac User
I'm simply amazed. OMU ***
My response
I dare why you are amazed. For me I think that an approximate method (the Z´s) must not have a rigorous performance…
EXAMPLE
Observed
__pX= 0.2__pY=0.5_____nX=nY=30_____w=0.08
EXACT: p(2 tails) = 0.03266 (since <0.05 we conclude that, at the 95% confidence level the difference between |p(X) – p(Y)| and w=0.08 or more is NOT to be expected.
HOWEVER by the Z test
______Z0 = 1.8819___(<1.960) the difference above is admissible.
Furthermore the C.I. is
_____0.071 < w < 0.529
witch includes (OF COURSE) w=0.08.
******
EVIDENTLY these are CHOSED examples: in the majority of cases the Z method does provide right DECISIONS (even that the alpha values are somewhat wrong, but this is not the matter that matters).
What is IMPORTANT is that the Technology nowadays allows s to discard a method (Z) that is sometimes MISLEADING.
As simple as this…Why to do a DRAMA of a so simple thing?
_______licas (Luis A. Afonso)
Someone available to CHECK my program I would be thankful.
REM "FOR2"
1 CLS
PRINT " d1=x/n1 , d2=y/n2 ---> |d1-d2| <= W "
PRINT " ** ** ** ** ** ** ** ** ** ** ** ";
PRINT "** ** ** ** ** ** ** ** ** ** ** "
DEFDBL A-Z
INPUT " pX "; p1
INPUT " pY "; p2
INPUT " nX "; n1: x = n1 * p1
INPUT " nY "; n2: y = n2 * p2
INPUT " w "; w
nnx = n1 - INT(n1): nny = n2 - INT(n2)
IF nnx < 0 OR nny < 0 THEN GOTO 1
PRINT " ** ** ** ** ** ** ** ** ** ** ** ";
PRINT "** ** ** ** ** ** ** ** ** ** ** "
DIM px(n1), py(n2)
px(0) = (1 - p1) ^ n1
FOR j = 0 TO n1 - 1
px(j + 1) = px(j) * (n1 - j) / (j + 1) * p1 / (1 - p1)
NEXT j
py(0) = (1 - p2) ^ n2
FOR j = 0 TO n2 - 1
py(j + 1) = py(j) * (n2 - j) / (j + 1) * p2 / (1 - p2)
NEXT j
REM
LOCATE 9, 1
pp = 0: FOR yy = 0 TO n2
FOR xx = 0 TO n1
d = ABS(xx / n1 - yy / n2)
IF d > w THEN GOTO 22
pp = pp + px(xx) * py(yy)
22 NEXT xx: NEXT yy: LOCATE 7, 50
PRINT USING " 2tails = #.##### "; pp
REM current method
LOCATE 9, 1
INPUT " CRITICAL VALUE = "; CV
d = ABS(p1 - p2)
s = p1 * (1 - p1) / n1 + p2 * (1 - p2) / n2
s = SQR(s): z = (d - w) / s
LOCATE 10, 19
PRINT USING " Z value=###.####"; z
c2 = d + s * CV: c1 = d - s * CV
PRINT " C.I. for w -----> ";
PRINT USING " ###.#### "; c1; c2
END
.
- Follow-Ups:
- Re: Comparing fractions (or proportions)
- From: Old Mac User
- Re: Comparing fractions (or proportions)
- From: Old Mac User
- Re: Comparing fractions (or proportions)
- References:
- Comparing fractions (or proportions)
- From: Old Mac User
- Comparing fractions (or proportions)
- Prev by Date: Time Series
- Next by Date: regression model selection
- Previous by thread: Re: Comparing fractions (or proportions)
- Next by thread: Re: Comparing fractions (or proportions)
- Index(es):