|
BINOMIAL RATIO CONFIDENCE LIMITSName:
with -1 denoting the normal percent point function. If p1 and p2 are both 1, the resulting uncertainty is zero. If either p1 or p2 is zero, we have division by zero in the above formula. For that reason, we use the Bayes estimators of p1 and p2:
with V and U denoting the number of successes in the binomial trials. We then use these updated estimates for p1 and p2 in the above formula.
<p1> <n1> <p2> <n2> <alpha> <SUBSET/EXCEPT/FOR qualification> where <p1> is constant, parameter, or variable that contains the proportion of successes for the first sample; <n1> is constant, parameter, or variable that contains the number of trials for the first sample; <p2> is constant, parameter, or variable that contains the proportion of successes for the second sample; <n2> is constant, parameter, or variable that contains the number of trials for the second sample; <alpha> is constant or parameter that contains the significance level; <ratio> is a variable that contains the computed ratio (p1/p2); <lowlim> is a variable that contains the computed lower confidence limit; <upplim> is a variable that contains the computed upper confidence limit; and where the <SUBSET/EXCEPT/FOR qualification> is optional. The <p1>, <n1>, <p2>, and <n2> arguments can be either parameters or variables. If they are variables, then the variables must have the same number of elements. The <alpha> argument is always assumed to be either a constant or a parameter. If <p1> <n1> <p2> and <n2> are all parameters, then <ratio> <lowlim> and <upplim> will be parameters. Otherwise, they will be variables.
P1 N1 P2 N2 ALPHA
LET N1 = SIZE Y1 LET P1 = YSUM1/N1 LET YSUM2 = SUM Y2 LET N2 = SIZE Y2 LET P2 = YSUM2/N2 LET RATIO AL AU = BINOMIAL RATIO CONFIDENCE LIMITS ... P1 N1 P2 N2 ALPHA If you have group-id variables (X1 and X2), you would do something like
LET YSUM1 = CROSS TABULATE SUM Y1 X1 LET N1 = CROSS TABULATE SIZE Y1 X1 LET P1 = YSUM1/N1 LET YSUM2 = CROSS TABULATE SUM Y2 X2 LET N2 = CROSS TABULATE SIZE Y2 X2 LET P2 = YSUM2/N2 LET RATIO AL AU = BINOMIAL RATIO CONFIDENCE LIMITS ... P1 N1 P2 N2 ALPHA In this case, P1, N1, P2, and N2 are now variables rather than parameters.
LET P1 = 8/12 LET N1 = 12 LET P2 = 7/8 LET N2 = 8 LET ALPHA = 0.05 . LET ARATIO LOWLIM UPPLIM = BINOMIAL RATIO CONFIDENCE LIMIT ... P1 N1 P2 N2 ALPHAThe values of ARATIO, LOWLIM, and UPPLIM are 0.7846, 0.4687, and 1.3135, respectively.
Date created: 10/5/2010 |